Bundling & runtimes
Module formats
Section titled “Module formats”The package is "type": "module" and ships three builds through its exports
map:
| Condition | File | Format |
|---|---|---|
import (bundlers, Node ESM) |
dist/index.mjs |
ESM |
require (Node CommonJS) |
dist/index.cjs |
CommonJS |
browser (bundler browser target) |
dist/index.browser.mjs |
ESM, minified |
types |
dist/index.d.ts |
TypeScript declarations |
import { CalimeroClient } from '@calimero-network/mero-js';// or: const { CalimeroClient } = require('@calimero-network/mero-js');It sets "sideEffects": false, so a bundler drops what you do not import.
The one dependency
Section titled “The one dependency”@phala/dcap-qvl verifies TDX
quotes. It is imported dynamically, the first time the client meets a real
quote, so a development page against mock quotes never loads it. In a browser
build it needs Node polyfills for buffer, crypto and stream; see its README
for Vite and webpack settings.
Runtimes
Section titled “Runtimes”| Browser | Node 18+ | Deno / Bun | React Native | |
|---|---|---|---|---|
CalimeroClient with an API key or a session |
✅ | ✅ | ✅ | ⚠️¹ |
browserPasskey() |
✅ | ❌² | ❌² | ❌² |
releaseSource: 'github' |
❌³ | ✅ | ✅ | ✅ |
- Needs WebCrypto with X25519: install
react-native-quick-cryptoas the globalcrypto. - WebAuthn is a browser API. Elsewhere, sign in with an API key, or implement
PasskeyProvideryourself. - GitHub’s release downloads send no CORS headers; the default mirror does.
Browsers
Section titled “Browsers”- Origins. The node runs passkey ceremonies, and answers CORS, only for
the origins it was started with (
--origins,http://localhost:3000by default), with passkeys bound to its--rp-id(localhostby default). A page on another origin fails the ceremony. - Secure context. WebAuthn needs
https://orlocalhost. - Sessions. Keep a
CalimeroSessioninsessionStorageand hand it touseSessionon the next page load, so a reload does not prompt for the passkey again.