stoka-typescript
Official TypeScript / JavaScript client for the stoka x402 storage API.
Stoka is a paid key/value blob store you hit with an HTTP request and pay for per byte in USDC on Stellar. No accounts. No monthly bill. A failed 402 tells you exactly what to pay, and this client signs it for you in-process.
What it does
- Native x402 "exact" scheme signer for Stellar USDC payments — no subprocess, no
bun, no secondary runtime. - Drives the
store/retrieve/update402 retry loop automatically: first request triggers the 402, the client signs a Soroban authorization entry, retries, returns the body. - Same shape on Node and the browser:
- Node — pass a Stellar
S…seed; the client signs with a keypair in process. - Browser — pass a SEP-43 wallet (Freighter / xBull / Lobstr / Rabet); the wallet owns the key and approves each payment.
- Node — pass a Stellar
Next steps
- Quickstart — 20 lines of code, real testnet USDC
- API reference — every exported symbol
- Source
Requirements
- Node 20 or later (for the server flow)
- A modern browser with a SEP-43 wallet installed (for the browser flow)
@stellar/stellar-sdkis a direct dependency (already installed transitively)