# decane-node > Server-side SDK for Decane Connect Kit (`decane-node`, MIT, TypeScript declarations included) — the `@privy-io/node` equivalent. Verify a caller's Decane access token, resolve their wallet addresses, and — with a developer API key — sign users in from any Node backend (email OTP, Google/KingsChat token exchange, custom-auth JWT exchange). No app secret required: tokens are ES256-signed JWTs, so verification needs only a public key — either your project's static verification key (offline, no network call) or Decane's published JWKS, which the SDK fetches, caches, and auto-rotates. This file is a self-contained integration spec, grounded in the actual package source. ``` npm install decane-node ``` Node 18+ (global `fetch`). On older Node, pass a `fetch` implementation in the client options. Dual ESM + CJS build. Single runtime dependency: `jose`. --- ## Version and freshness ```yaml package: decane-node version: 1.8.0 document-revision: 2026-09-26 canonical: https://kit.decane.app/llms-node.txt version-manifest: https://kit.decane.app/llms-version.json # under the "node" key web-sibling: https://kit.decane.app/llms.txt # decane-connect-kit (browser) expo-sibling: https://kit.decane.app/llms-expo.txt # decane-connect-kit-expo (React Native) python-sibling: https://kit.decane.app/llms-python.txt # decane on PyPI (the same surface) rust-sibling: https://kit.decane.app/llms-rust.txt # decane on crates.io (the same surface) ``` This package runs **only on the server**. The browser SDK (`decane-connect-kit`) and the React Native SDK (`decane-connect-kit-expo`) are separate packages with their own specs at the sibling URLs above. Do not mix their APIs: `decane-node` has no React components, no hooks, no wallet UI, and never touches key material — it authenticates users, verifies tokens, reads public addresses, and (1.5.0+) can ask Decane to create a user's wallet ahead of their first sign-in. Signing stays in the client SDKs. --- ## What it is for 1. **Verify** an access token presented to your API → `verifyAccessToken` 2. **Identify** the caller → `claims.userId` (stable Decane user id — a UUID) 3. **Scope** to your app → `appId` vs the token's `project_id` 4. **Resolve addresses** → `getAddresses` / `getUser` (`{ evm, solana, tron }`) 5. **Sign users in server-side** (since 1.2.0) → `connectWithEmail` + `verifyEmailCode`, `connectWithGoogleToken`, `connectWithKingsChatToken`, `connectWithToken` (custom auth), `revokeAccessToken`, linked logins (`linkExternalLogin`, `listLinkedLogins`, `unlinkLogin`) --- ## Minimal working setup — verification ```ts import { DecaneClient } from "decane-node"; // Static key (recommended for backends) — copy the ES256 verification key from // your Decane dashboard (API Keys page). appId is checked against the token's // project_id. verificationKey also falls back to the DECANE_VERIFICATION_KEY // env var, so a backend can pass only appId in code. const decane = new DecaneClient({ appId: process.env.DECANE_APP_ID, verificationKey: process.env.DECANE_VERIFICATION_KEY, // ES256 SPKI PEM }); // In your auth middleware: const token = req.headers.authorization?.replace("Bearer ", "") ?? ""; const claims = await decane.verifyAccessToken(token); // throws DecaneAuthError if invalid req.userId = claims.userId; // stable Decane user id — key your records off this ``` To verify against the remote JWKS instead, omit `verificationKey`: ```ts const decane = new DecaneClient({ appId: process.env.DECANE_APP_ID }); ``` Construct **one client per project and reuse it** — the JWKS is fetched lazily and cached across calls, and `jose` refetches automatically when it sees an unknown key id, so Decane key rotation needs no redeploy. --- ## Minimal working setup — server-side sign-in (1.2.0+) Sign-in calls need your **developer API key** (`dck_live_…`, from the Decane dashboard), passed as `apiKey` or via the `DECANE_API_KEY` env var. It is sent as `X-API-Key`. **Treat it as a secret** — a server request carries no Origin header, so the browser-SDK origin allowlist does not protect it; the key alone is the credential. Verify-only usage never needs it. ```ts const decane = new DecaneClient({ appId: process.env.DECANE_APP_ID, apiKey: process.env.DECANE_API_KEY, }); // Email OTP — two steps await decane.connectWithEmail("user@example.com"); // emails a 6-digit code const session = await decane.verifyEmailCode("user@example.com", "123456"); // Token exchanges — one step each await decane.connectWithGoogleToken(googleIdToken); // Google ID token you already hold await decane.connectWithKingsChatToken(kcAccessToken); // KingsChat OAuth access token await decane.connectWithToken(jwtFromYourIssuer); // custom auth (your own issuer) // Every sign-in resolves to: interface DecaneAuthResult { accessToken: string; // Decane JWT: 8 h expiry, renewable via POST /auth/refresh (below) userId: string; // stable Decane user id isNewUser: boolean; hasShare: boolean; // false = no wallet yet: the client SDK creates one on this sign-in, unless createUser did profile?: { name?: string; email?: string; picture?: string }; // google/kingschat only } // Compose with the rest of the SDK: const user = await decane.getUser(session.accessToken); // id + addresses await decane.revokeAccessToken(session.accessToken); // sign-out ``` **Not available server-side** (they need a browser or a device authenticator): the Google redirect flow, the interactive KingsChat popup, passkey sign-in, wallet creation, and signing. Do not look for them here. --- ## Verification modes Exactly one strategy is active per client, chosen at construction: - **Static verification key** (Privy-style, offline). Set `verificationKey` (or the `DECANE_VERIFICATION_KEY` env var) to your project's ES256 SPKI PEM public key. Verification is fully local — no network call, works air-gapped. Literal `\n` escapes in the PEM are normalised, so a single-line env value works. This is a *public* key; it is not a secret. - **JWKS** (default, zero-config). With no key present, tokens are verified against `${apiBase}/.well-known/jwks.json` (override with `jwksUrl`). Fetched lazily, cached, auto-rotated. JWKS retrieval always uses the runtime's global fetch (called inside `jose`) — the injectable `fetch` option does not apply to it. Both modes check the ES256 signature and expiry; when `appId` is set, both also require the token's `project_id` to equal it. Decane tokens set no `iss`/`aud` — `project_id` is the audience-equivalent. --- ## API ### `new DecaneClient(options?)` / `createDecaneClient(options?)` ```ts interface DecaneClientOptions { appId?: string; // reject tokens whose project_id differs; also sent as X-App-Id on sign-in calls verificationKey?: string; // ES256 SPKI PEM → offline verification. Env fallback: DECANE_VERIFICATION_KEY apiKey?: string; // dck_live_… key, required only for sign-in methods. Env fallback: DECANE_API_KEY projectSecret?: string; // dck_sk_… key, required only for the by-user-id record methods (1.4.0). Env fallback: DECANE_PROJECT_SECRET apiBase?: string; // env fallback DECANE_API_BASE, default "https://backend.decane.app"; an EMPTY value (option or env) counts as unset jwksUrl?: string; // default `${apiBase}/.well-known/jwks.json`; ignored when verificationKey is set fetch?: typeof fetch; // injected fetch for REST calls (tests, Node < 18); default global fetch } ``` Constructor throws (plain `Error`) only when no global `fetch` exists and none was injected (Node < 18). A missing `apiKey` throws — as a plain config `Error`, not a `DecaneApiError` — on the first sign-in call, never at construction. ### `decane.verifyAccessToken(token: string): Promise` Verifies signature + expiry, checks `project_id` against `appId` when configured, and requires a `uid` claim. Throws `DecaneAuthError` on any untrusted token. ```ts interface DecaneClaims { userId: string; // uid — stable Decane user id (a UUID). Key your records off this. subject: string; // sub — HMAC of the auth-provider identity (not reversible to an email) projectId?: string; // project_id tokenId?: string; // jti — unique per issued token issuedAt?: number; // iat, seconds since epoch expiresAt?: number; // exp, seconds since epoch raw: JWTPayload; // full verified payload, for anything not surfaced above } ``` ### `decane.safeVerifyAccessToken(token): Promise` Same, but returns `null` instead of throwing — for fail-closed middleware. Only `DecaneAuthError` is swallowed; unexpected errors (e.g. JWKS network failure) still throw. ```ts const claims = await decane.safeVerifyAccessToken(token); if (!claims) return res.status(401).json({ error: "unauthorized" }); ``` ### `decane.getAddresses(token): Promise` Fetches the token owner's public wallet addresses from the Decane backend (`GET ${apiBase}/share/addresses`, token as bearer). Throws `DecaneAuthError` if the backend rejects the token. Never contains key material. ```ts interface DecaneAddresses { evm: string | null; solana: string | null; tron: string | null; } ``` ### `decane.getUser(token): Promise` Verify + resolve in one call. Addresses are **best-effort**: if the address fetch fails, they come back `null` rather than failing the call (the identity is already verified). ```ts interface DecaneUser { id: string; // uid addresses: DecaneAddresses; linkedAccounts: DecaneLinkedAccount[]; // Privy-compatible shape } interface DecaneLinkedAccount { type: "wallet"; chainType: "ethereum" | "solana" | "tron"; address: string; } ``` ### Sign-in methods (all require `apiKey`; all reject with `DecaneApiError` on failure) ```ts decane.connectWithEmail(email): Promise // POST /auth/email/start. ALWAYS resolves, known address or not // (anti-enumeration). Code: 6 digits, 10-min TTL, max 3/hour per address. decane.verifyEmailCode(email, code): Promise // POST /auth/email/verify. Wrong/expired code → DecaneApiError code "INVALID_CODE". decane.connectWithGoogleToken(idToken): Promise // POST /auth/google/token. idToken's `aud` must be the Google client id // configured for Decane. Resolves to the SAME wallet as the browser redirect // flow. result.profile: { name?, email?, picture? }. decane.connectWithKingsChatToken(accessToken): Promise // POST /auth/kingschat. accessToken is a KingsChat OAuth ACCESS token, not a // JWT. 503 → code "KINGSCHAT_UNAVAILABLE" (upstream down — distinct from a // bad token, which is 401 "AUTH_FAILED"). result.profile: { name?, email? }. decane.connectWithToken(token, opts?: { providerId?: string }): Promise // POST /auth/external — custom auth. Exchange a JWT from your own issuer // (Auth0, Clerk, Firebase, your backend), registered as an auth provider in // the Decane dashboard (issuer + JWKS URL + identity claim). providerId is // required only when >1 provider is enabled ("AMBIGUOUS_PROVIDER" otherwise). decane.linkExternalLogin(accessToken, token, opts?: { providerId?: string }): Promise<{ alreadyLinked: boolean; id?: string }> // POST /auth/link/external, since 1.6.0. Attach a login from your own issuer // (a phone number you verified, say) to the account behind accessToken, so it // opens the same wallet from then on. token must be fresh: exp and iat, issued // within 10 minutes. "LOGIN_IN_USE" (409) when it already opens another // account; accounts are never merged. Linking one already there is a no-op. decane.listLinkedLogins(accessToken): Promise // GET /auth/link/external. { id, providerId, providerName, identifier (masked), linkedAt }. decane.unlinkLogin(accessToken, id): Promise // DELETE /auth/link/external/:id — for "change my number". The login the // account was created with cannot be removed. decane.getKingsChatConfig(): Promise<{ clientId: string; authorizationUrl: string }> // GET /auth/kingschat/config. 400 "KINGSCHAT_NOT_CONFIGURED" when unset. decane.revokeAccessToken(token): Promise // POST /auth/revoke, bearer-only — the ONE auth call that needs no apiKey. // Adds the jti to the revocation list: backend calls (getAddresses) reject it // immediately; stateless verifyAccessToken still accepts it until exp. ``` ### Per-user records (1.4.0+) — the Privy custom-metadata replacement Every Decane user carries two flat JSON records, split by WHO may write them: - `preferences` — the user's own choices. Written with the USER'S access token (or the project secret). What a settings screen stores: a "post my trades" switch, a theme, a terms version the person accepted. - `metadata` — the app's facts about the user: plan, flags, ids in your own systems. Written ONLY with the project secret; a user token can read it and never change it. This is where an entitlement may live — the user cannot grant themself one. ```ts type DecaneRecord = Record; type DecaneRecordPatch = Record; // null removes the key // Keys: [A-Za-z0-9_.-]{1,64}. Strings ≤ 2048 chars. ≤ 100 keys, ≤ 32 KB serialised. Flat — no nesting. // With the user's token (no apiKey, no secret) — from a route that verified it: decane.getPreferences(token): Promise // GET /me/preferences decane.updatePreferences(token, patch: DecaneRecordPatch): Promise // PATCH /me/preferences — merge; resolves to the whole record decane.setPreferences(token, record: DecaneRecord): Promise // PUT /me/preferences — replace decane.getMetadata(token): Promise // GET /me/metadata — read-only on this side // The project secret needs the users:read scope to read and users:write to write (see llms.txt Part 5); a key without it gets 403 INSUFFICIENT_SCOPE. createUser needs users:create (+ wallets:create unless createWallet: false); createUserWallet needs wallets:create. // By user id, with `projectSecret` (dck_sk_…, minted on the project's page in the dashboard): decane.getUserMetadata(userId) // GET /v1/app/users/:id/metadata decane.updateUserMetadata(userId, patch) // PATCH — merge decane.setUserMetadata(userId, record) // PUT — replace decane.getUserPreferences(userId) / updateUserPreferences(userId, patch) / setUserPreferences(userId, record) ``` Failures reject with `DecaneApiError`: `INVALID_RECORD` (400; the message names the offending key), `NOT_FOUND` (404; no such user in the secret's project — the same answer for a user of another app as for a made-up id), `UNAUTHORIZED` (401; token expired or revoked, or a bad secret). Calling a `*User*` method without a secret throws a plain config `Error` before any network call, like a sign-in call without an `apiKey`. Absent keys are absent — a record that was never written is `{}`. Decide your defaults in code (`prefs.shine_perps ?? true`) rather than writing them on first read, so "never touched it" stays distinguishable from "chose it". ### Server-side user and wallet creation (1.5.0+) Your backend can create a user, and their wallet, before the person has ever signed in — to fund an address ahead of onboarding, or to move accounts from another system. Decane keys the user exactly as the matching sign-in will, so the person's first sign-in with that identifier opens the wallet made here and the client SDK creates nothing. The enclave generates the key; your server only ever sees the addresses. ```ts type DecaneUserIdentifier = | { type: "email"; value: string } // any case; links a later email-code OR Google sign-in | { type: "phone"; value: string } // E.164: + | { type: "custom"; value: string; providerId: string } // the subject your JWTs assert, + the provider's id | { type: "kingschat"; value: string } // the provider's stable user id, never an @handle | { type: "x"; value: string }; decane.createUser(identifier, { createWallet?: boolean /* default true */, metadata?: DecaneRecordPatch }) // POST /v1/app/users → Promise decane.createUserWallet(userId) // POST /v1/app/users/:id/wallet — for an existing walletless user interface DecaneCreatedUser { user: { id: string; authMethod: string; identifier: string | null /* masked */; addresses: DecaneAddresses }; created: boolean; // this call made the user row wallet: "created" | "exists" | "none"; // "none" only with createWallet: false and no wallet yet } // Look up one user (1.8.0+), needs users:read. How a server learns a signed-in // user's email: decane_email on a Google redirect is plain text the browser can // edit, and the token carries no email. Verify the token, then: decane.getUserById(claims.userId) // GET /v1/app/users/:id → DecaneAppUser; NOT_FOUND if not this project's // DecaneAppUser: { userId, authMethod, identifier (masked), email, emailVerified, // emailUnsubscribed, evmAddress, solanaAddress, tronAddress, createdAt, lastSeenAt } // Trust email only when emailVerified (proved by a code or Google's verified claim). // Payments (1.7.0+): checkout (pay-in) + withdrawals (pay-out), Dextopus-settled. // Needs a key with the `payments` scope and payments turned on for the project. // Amounts are base units of the asset. Decane adds a partner-fee markup per payment. decane.createCheckout({ amount, settlementChainId?, orderRef?, successUrl?, metadata?, expiresIn? }) // POST /v1/app/checkout → DecanePayment. A payment request settling to the // project's address (settlementChainId omitted: Base, then the other EVM chains // the project's EVM address covers, then Solana, then Tron); `url` is the hosted checkout page, `depositAddress` is // filled once the payer picks a pay-token. You learn it settled by the webhook. // The payer picks a network, then its native coin, USDC or USDT (only networks // of a family the project has an address on). They give no refund address: a // payment that cannot settle is refunded to the PROJECT's address on the payer's // network family. Set addresses on the dashboard's Payments page (one EVM // address covers every EVM chain; Solana and Tron optional; at least one). decane.createWithdrawal({ originChainId, originAsset, amount, destChainId, destAsset, destAddress, refundTo, orderRef?, metadata?, expiresIn? }) // POST /v1/app/withdrawals → DecanePayment. Cross-chain pay-out: the holder // sends `amount` of what they have to `depositAddress`, settles to the dest. // refundTo here is the sender's own origin-chain address. decane.getPayment(id) // GET /v1/app/payments/:id → DecanePayment decane.listPayments(limit?) // GET /v1/app/payments → DecanePayment[] (default 50, max 200) decane.paymentOptions() // GET /v1/app/payments/options → { chainId, chainName, asset, symbol, name, decimals, logoUrl, label }[] // the live Dextopus list, filtered to the project's networks (the TS type lists the original three fields) decane.createDepositAddress(userRef, settlementChainId?) // POST /v1/app/deposit-addresses → reusable per-user address interface DecanePayment { id: string; kind: "checkout" | "withdrawal"; status: "open" | "pending" | "paid" | "partial" | "expired" | "failed"; // partial: settled clearly short amount: string; settlement: { chainId: number; asset: string; address: string }; orderRef: string | null; expiresAt: string; depositAddress: string | null; payChainId: number | null; payAsset: string | null; amountIn: string | null; settledAmount: string | null; originTx: string | null; settlementTx: string | null; metadata: unknown; createdAt: string; url: string | null; // url: hosted checkout page (checkouts) } // Webhook events (to the project's webhook_url): payment.created | payment.completed // | payment.partial | payment.failed | payment.expired (checkouts accept any amount: judged by what settled; settledAmount is base units), each with `data` carrying the DecanePayment-shaped body and `kind`. ``` Idempotent on the identifier: a second `createUser` returns the same user with `wallet: "exists"`. An email that an earlier Google sign-in already recorded resolves to that existing user (no second wallet). The person's first sign-in still reports `isNewUser: true` — "new" means the first sign-in, not the row's age — and the wallet-ready email goes out then, not at creation. Off by default: the Decane team switches it on per project (`SERVER_WALLETS_DISABLED` until then). Sixty calls a minute per project; three creation attempts per user per hour on the enclave (`RETRY_LATER`). Failures reject with `DecaneApiError`: `INVALID_IDENTIFIER` (400), `SERVER_WALLETS_DISABLED` (403), `WALLET_EXISTS` / `WALLET_FROZEN` (409), `RETRY_LATER` (429), `ENCLAVE_UNAVAILABLE` (503; retry). A `user.wallet_created` webhook (`origin: "server"`) is delivered to the project's endpoint, once. ### Standalone `verifyAccessToken(args)` — the Privy drop-in ```ts import { verifyAccessToken } from "decane-node"; const claims = await verifyAccessToken({ token, // required appId: "proj_…", // optional verificationKey: "…", // optional — offline mode apiBase: "…", // optional jwksUrl: "…", // optional }); ``` Caches a client per unique config internally, so it is cheap to call per request — the JWKS is not refetched each time. There are deliberately NO standalone sign-in helpers — the apiKey is a secret tied to a constructed client. ### Errors ```ts export const DEFAULT_DECANE_API_BASE = "https://backend.decane.app"; // The resolved base is readable: `client.apiBase`. Resolution is option → DECANE_API_BASE env → default, // and an empty or whitespace value at any step is treated as unset (1.3.1). Deploy templates that write // `DECANE_API_BASE: ${DECANE_API_BASE:-}` therefore no longer send every request to a relative URL. export class DecaneAuthError extends Error { // VERIFICATION failures reason: "invalid_token" | "missing_uid" | "project_mismatch"; cause?: unknown; } export class DecaneApiError extends Error { // SIGN-IN / API failures code: string; // INVALID_CODE | AUTH_FAILED | INVALID_TOKEN | NO_PROVIDER | // AMBIGUOUS_PROVIDER | MISSING_CLAIM | BAD_REQUEST | // INVALID_API_KEY | APP_ID_MISMATCH | KINGSCHAT_NOT_CONFIGURED | // KINGSCHAT_UNAVAILABLE | REVOKE_FAILED | RATE_LIMITED | // INVALID_RECORD | NOT_FOUND | UNAUTHORIZED (1.4.0, the record methods) | // SERVER_WALLETS_DISABLED | INVALID_IDENTIFIER | WALLET_EXISTS | WALLET_FROZEN | // ENCLAVE_UNAVAILABLE | RETRY_LATER (1.5.0, createUser / createUserWallet) | // UNKNOWN | NETWORK_ERROR status: number; // HTTP status; 0 when the request never completed cause?: unknown; } ``` Synthesised codes: bare HTTP 429 → `RATE_LIMITED`; unparseable error body → `UNKNOWN`; fetch threw → `NETWORK_ERROR` with `status: 0`. --- ## Recipes ### Express middleware ```ts import { DecaneClient } from "decane-node"; const decane = new DecaneClient({ appId: process.env.DECANE_APP_ID }); export async function requireAuth(req, res, next) { const token = req.headers.authorization?.replace("Bearer ", "") ?? ""; const claims = await decane.safeVerifyAccessToken(token); if (!claims) return res.status(401).json({ error: "unauthorized" }); req.userId = claims.userId; next(); } ``` ### Next.js route handler ```ts // app/api/me/route.ts import { NextResponse } from "next/server"; import { DecaneClient } from "decane-node"; const decane = new DecaneClient({ appId: process.env.DECANE_APP_ID }); export async function GET(req: Request) { const token = req.headers.get("authorization")?.replace("Bearer ", "") ?? ""; const claims = await decane.safeVerifyAccessToken(token); if (!claims) return NextResponse.json({ error: "unauthorized" }, { status: 401 }); return NextResponse.json(await decane.getUser(token)); } ``` Module scope is correct for the client — the instance (and its JWKS cache) is shared across requests. ### Backend-owned login endpoint (server-side sign-in) ```ts const decane = new DecaneClient({ appId: process.env.DECANE_APP_ID, apiKey: process.env.DECANE_API_KEY, }); app.post("/login/email/start", async (req, res) => { await decane.connectWithEmail(req.body.email); res.json({ ok: true }); // always — never reveal whether the email exists }); app.post("/login/email/verify", async (req, res) => { try { const session = await decane.verifyEmailCode(req.body.email, req.body.code); res.json({ token: session.accessToken, userId: session.userId }); } catch (err) { if (err instanceof DecaneApiError && err.code === "INVALID_CODE") return res.status(400).json({ error: "wrong code" }); throw err; } }); ``` ### Getting the token on the client Web (`decane-connect-kit`): `const { getAccessToken } = useSocialAuth(); const token = await getAccessToken();` React Native (`decane-connect-kit-expo`): `const token = decane.getAccessToken();` All three SDKs mint tokens from the same backend, so one `DecaneClient` verifies users from web, mobile, and server-side sign-ins alike. Send as `Authorization: Bearer `. --- ## Gotchas an agent should not re-derive - **Verification is stateless.** Signature + expiry + `project_id` only — it does not consult Decane's server-side revocation list. A token stays verifiable until `exp` even after sign-out or `revokeAccessToken`. For immediate sign-out enforcement, additionally gate sensitive routes on a fresh backend call (`getAddresses(token)` works — the backend rejects revoked tokens). - **Tokens last 8 hours and renew, but there is no separate refresh token.** `POST /auth/refresh` with a still-valid token as the Bearer returns `{ jwt, expiresIn, sessionExpiresIn }`; the chain is capped at 7 days from the sign-in, after which it answers 401 and the user signs in again. The client SDKs call it automatically at 75% of the token's life; `decane-node` does not wrap it yet — call the endpoint directly if your server holds the token. An expired token cannot be refreshed. - **There is no per-IP rate limit on the auth endpoints.** Funnelling every user through one egress IP is fine. What IS limited: OTP attempts, at 10 per 15 minutes **per target email or phone** (guessing one account's code), and code sends, at 3 per hour per address; and `/auth/unlock-token/exchange`, at 30 per 15 minutes per token. - **`hasShare: false` means the user has no wallet yet.** Wallet creation needs device-held key material and happens only in the client SDKs; `getAddresses` returns all-null for such users. - **The `dck_live_…` apiKey is a secret** — server env only. The browser origin allowlist does not apply to server calls. - **`uid` is a UUID, not `did:privy:…`.** Migrating from Privy: rows keyed by a Privy id will not match a Decane `uid`. Map legacy ids during a re-auth window before cutting production over. - **No app secret exists.** Do not look for one. The dashboard's verification key is a public key. - **`jwksUrl` is ignored when `verificationKey` is set.** Exactly one verification strategy is active per client. - **The injectable `fetch` option covers REST calls only** (addresses + sign-in). JWKS retrieval always uses the runtime's global fetch inside `jose`. - **Expired tokens throw with `reason: "invalid_token"`** (message "Access token has expired."), not a distinct reason. - **`getUser` never throws for address failures** — only for verification failures. If addresses matter, call `getAddresses` directly and handle its errors. - **Since 1.2.0 `chainType` includes `"tron"`** — exhaustive switches on `DecaneLinkedAccount.chainType` need a `tron` arm. --- ## Package - npm: https://www.npmjs.com/package/decane-node - Install: `npm install decane-node` - License: MIT - Runtime: Node 18+ (or inject `fetch`) - Dependency: `jose` only - TypeScript: declarations included, no `@types` package needed ## Optional (human-readable pages) - Node SDK documentation: https://kit.decane.app/node-docs - Web SDK documentation: https://kit.decane.app/docs - Landing page: https://kit.decane.app