npm package
Install
brickken-sdk from npm.GitHub repository
View the public source repository.
Why this surface
The SDK is the client to reach for when your own code is driving. Unlike the CLI, it reaches the full Dapp API; unlike the MCP server, it runs in your process rather than behind a hosted agent endpoint.- One client, three APIs. Dapp, agentic, and RAMS live behind the same
Brickkeninstance. - Illegal combinations fail locally. The SDK derives the credential mode from what you pass and refuses combinations the API rejects, before a request leaves your process.
- Typed results, typed errors. Every write returns the same
WriteResultshape, and every failure is one of fourteen error classes you can branch on. - Your private key stays put. It signs x402 payments,
client-signedtransactions, and RAMS typed data in your process, and is never sent anywhere.
Two credentials, and they are alternatives
Brickken accepts an API key or an x402 payment, never both on one request. Whenx-api-key is present the API skips the payment path entirely, which means no payment is taken and brickken-relayed execution becomes unavailable.
The SDK enforces this locally:
Every write is prepare → sign → send
Preparing builds unsigned transactions; sending puts them on chain. The SDK defaults to prepare-only, soexecute: true is an explicit opt-in.
Where to go next
Installation
Runtimes, module formats, and optional peer dependencies.
Quickstart
A first Dapp read and a first agentic write, on sandbox.
Execution modes
Who signs, who broadcasts, and what each mode costs.
Namespaces
Every method, mapped to its backend endpoint.
Prerequisites the API does not expose
Two things fail at request time and are invisible beforehand:- The wallet you pass as
signerAddressmust be whitelisted by Brickken before any prepare accepts it. Request it together with your API key. - An API key may only act on token symbols whose tokenizer email matches a
newTokenizationperformed under that same key. Anything else raisesUnauthorizedTokenSymbolError.
CreditsExhaustedError, carrying .method.