SDK compatibility matrix
This matrix describes the supported runtime surface for @dlbr/eid-sdk@0.1.0-beta.2. The SDK is a server-side package: API keys must remain in runtime secrets and must never be bundled into browser code.
| Runtime or framework | Support | Requirements and notes |
|---|---|---|
| Node.js | Supported | Node.js 20+; ESM import; global fetch is required. Provide a WebSocket constructor when the runtime does not expose one and sessions.events is used. |
| Bun | Supported | Current Bun 1.x; use the native fetch and WebSocket implementations. |
| Deno | Supported | Current Deno release; import through npm:@dlbr/eid-sdk and grant --allow-env --allow-net. |
| Cloudflare Workers | Supported | Use Worker secrets/bindings for credentials; the runtime provides fetch and WebSocket support. |
| Express / Fastify | Supported | Run on a supported Node.js runtime; keep one SDK client per credential set. |
| Hono | Supported | Supported on Node.js and Cloudflare Workers with server-side bindings. |
| Next.js App Router | Supported | Use a server route with runtime = "nodejs"; never expose values through NEXT_PUBLIC_*. |
| Browser / React client | Not supported | The SDK requires a trusted server boundary because API keys are bearer credentials. Return only the session data the browser needs from your backend. |
Runtime requirements
- ESM is the supported module format. The package does not publish a CommonJS entry point.
fetchcan be replaced with the constructor'sfetchoption for test harnesses or runtimes with a compatible implementation.sessions.events.connect()additionally requires a WebSocket implementation; passwebSocketwhen the runtime does not provide a global constructor.- Node.js, Bun, Deno, and Workers examples are maintained in
packages/sdk/examplesand linked from the quickstarts.
Environment compatibility
The SDK uses the same resource API in both environments. Select the matching pair explicitly:
| Gateway environment | Key prefix | mode |
|---|---|---|
| Sandbox / staging | sk_test_ | test |
| Live / production | sk_live_ | live |
The client rejects an explicit mode/key mismatch and requires an HTTPS base URL for live mode.
Support policy
Compatibility is evaluated against the matrix when a release is cut. Runtime minimums and framework behavior are public compatibility claims; changes to them follow the SemVer and deprecation policy. If a runtime falls out of vendor support, it moves to a documented maintenance state before removal from this matrix.