How to import Lucid.

Lucid is written in Deno, but can be used in many other JavaScript runtimes too.

Using Deno

Make sure you have Deno installed.

import { Lucid } from "";

const lucid = await;

Hint: We always recommend importing libraries including the version tag:
For simplicity we leave it out in the documentation.

Visual Studio Code configuration

If you use Visual Studio Code, it's highly recommended to install the Deno extension.

Using NPM/Node.js

Make sure you have Node.js installed.

Add Lucid to your project:

npm install lucid-cardano

then import it:

import { Lucid } from "lucid-cardano";

const lucid = await;

Note: Lucid is an ES Module. You need to set {"type" : "module"} in your package.json.
To bundle your NPM project you may need to adjust your bundler. For instance when using Webpack you need to enbale in the webpack.config.json:

experiments: {
    "asyncWebAssembly": true,
    "topLevelAwait": true,
    "layers": true // optional, with some bundlers/frameworks it doesn't work without

Using Web

Create a html file and import Lucid in a <script> tag:

<script type="module">
import { Lucid } from ""
const lucid = await;

Build locally

Clone the repository:

git clone

With Deno you can simply import Lucid like this (at the root of the Lucid folder):

import { Lucid } from "./mod.ts";

For NPM and web bundle you need to build Lucid first. Go to the root of the Lucid folder and execute:

deno task build

This will output a dist folder at the root containing the NPM and web bundle.