Stack
Mesh SDK vs Lucid Evolution
Both are pure-JS Cardano SDKs that work in the browser and on Cloudflare Workers. Pick one per project and stick with it — mixing them mid-build causes type confusion.
High-level wrappers, React hooks (@meshsdk/react), CIP-25 NFT helpers, and a large template library. Great for beginners.
bun add @meshsdk/core @meshsdk/react
import { BrowserWallet, MeshTxBuilder, BlockfrostProvider } from "@meshsdk/core";
const wallet = await BrowserWallet.enable("lace");
const provider = new BlockfrostProvider(process.env.BLOCKFROST_PROJECT_ID_PREVIEW!);
const tx = new MeshTxBuilder({ fetcher: provider, submitter: provider });meshjs.dev ↗Minimal, composable, TypeScript-first. Preferred for Aiken validator dApps and low-level tx control.
bun add @lucid-evolution/lucid
import { Lucid, Blockfrost } from "@lucid-evolution/lucid";
const lucid = await Lucid(
new Blockfrost("https://cardano-preview.blockfrost.io/api/v0", process.env.BLOCKFROST_PROJECT_ID_PREVIEW!),
"Preview",
);
const api = await (window as any).cardano.lace.enable();
lucid.selectWallet.fromAPI(api);lucidevolution.io ↗Blockfrost / Maestro / Koios project IDs are server-side secrets. Add them via Lovable's secrets UI as BLOCKFROST_PROJECT_ID_PREVIEW / BLOCKFROST_PROJECT_ID_PREPROD and read them from a createServerFn handler — never expose them to the browser bundle.
For validators, use Aiken. Keep the Aiken project in onchain/ and commit the compiled plutus.json — Lovable's build container doesn't run aiken build.