Docs/Merchants

Install

The @obscura-app/merchant-sdk package gives you one Express-style middleware that handles x402 payment challenges and on-chain verification. Any route it wraps becomes a paid endpoint: the middleware returns 402 until the client pays via Obscura's confidential mixer, verifies the on-chain proofs, then hands off to your downstream handler.

Requirements

  • Node 18 or later and any framework with Express-style middleware — Express itself, Fastify (via fastify-express), Hono's adapter, or similar.
  • An Obscura merchant account. Sign in and pick the merchant role to get a custodied Umbra ETA address — no crypto-native tooling required.
  • A Solana RPC endpoint. The middleware reads the queue + callback transactions from chain to verify each payment. The default public RPC is rate-limited; pass your own (Helius works well) for production.

Install the SDK

terminal·bash
npm install @obscura-app/merchant-sdk express

# or pnpm:
pnpm add @obscura-app/merchant-sdk express

# or yarn:
yarn add @obscura-app/merchant-sdk express

Verify

terminal·bash
node -e "console.log(require('@obscura-app/merchant-sdk/package.json').version)"

You're ready. The Quickstart gets you to a verified payment in about five minutes.