@dynamoprotocol/sdkTypeScript-first, Node 20+. The published SDK is a thin wire client (surface 2.0.0): it holds credentials, manages budgets and streams through your instance's versioned owner-api (owner-api/1.0.0), signs and verifies what a client must sign and verify, and re-implements nothing — the engine and every enforcement decision live with the core it talks to. See the generated reference for every export, pinned to that surface by the build.
npm install @dynamoprotocol/sdk
Every call needs your instance credentials:
export DYNAMO_CORE_URL=https://your-instance-url
export OWNER_API_TOKEN=your-owner-api-token
| Object | What it is |
|---|---|
Dynamo | The client. Dynamo.open({ coreUrl, token }) connects to your instance; the token is required — the owner-api refuses anonymous callers (fail closed) |
Budget | One funded ceiling — a ledger record, an escrow deposit, or a card authorization — fanned out into streams |
Stream | A capped, revocable, per-second child allowance aimed at one service node. Meters via tick, delegates via delegate, revokes instantly |
SessionKey | A scoped voucher signer for direct settlement flows; wire-opened streams keep their scoped key with the core, same one-stream blast radius (session keys) |
Session | The reconciled aggregate a closed budget returns from budget.aggregate() |
x402 | Both sides of payment-required HTTP: challenges, payments, offline verification (x402) |
Every amount is integer micro-USD held in bigint; every metered quantity is integer units; money crosses the wire as decimal digit strings only. The helpers usd("20"), microUsd(20_000_000n), and units(500_000n) construct branded values — floating point never enters an amount, a rate, or a fee. The metered quantity is deliberately called units and the payee a serviceNode: the protocol is payload-neutral and prices work, whatever the work is.
Rule of the published package: additive changes bump the minor version with a CHANGELOG entry; a breaking change without a written deprecation note is forbidden. 2.0.0 is the first published surface — the wire client; the 1.x embedded-engine surface was never published, and the package CHANGELOG carries the migration note.