Install
The @obscura-app/sdk package wraps fetch() and handles the x402 payment
handshake on 402 responses. Your agent code stays a normal HTTP client —
Obscura signs the confidential on-chain transfer on your behalf when a
paid API asks for payment.
Requirements
- Node 18 or later. The SDK uses the native
fetchAPI. On older runtimes, inject a polyfill via thefetchconstructor option. - An Obscura account. Sign in with Google. The signup flow gives you a custodied agent wallet on first top-up — see Quickstart.
Install the SDK
terminal·bash
npm install @obscura-app/sdk
# or pnpm:
pnpm add @obscura-app/sdk
# or yarn:
yarn add @obscura-app/sdkVerify
A minimal sanity check — this should print the installed version:
terminal·bash
node -e "console.log(require('@obscura-app/sdk/package.json').version)"You're ready. The Quickstart gets you to a first paid call in about three minutes.