Node.js SDK
TypeScript/JavaScript SDK for Custena. Issue API keys, settle calls, and wrap any Node MCP server in minutes.
@custena/sdkv0.1.0~2 min
Installation
npm install @custena/sdkFor sellers — wrap an MCP server
import { createCustenaProxy } from "@custena/sdk/server";
const proxy = createCustenaProxy({
apiKey: process.env.CUSTENA_SECRET_KEY!,
upstream: "http://localhost:5000",
pricePerCall: { currency: "USD", amount: 0.01 },
});
proxy.listen(4000);Every request to your proxy is authenticated, priced, and forwarded to the underlying MCP server. Payments arrive in your Custena ledger — withdraw via Stripe Connect or convert to USDC.
For buyers — agent client
import { Custena } from "@custena/sdk";
const pp = new Custena({ apiKey: process.env.CUSTENA_API_KEY! });
const response = await pp.invoke(
"https://seller.example.com/tools/search",
{ q: "hello world" },
);The client automatically attaches the correct payment headers for whatever protocol the seller supports — no wallet, no signing, no manual top-up handling.
Environment variables
| Variable | Purpose |
|---|---|
CUSTENA_API_KEY | Buyer-side key (starts with pk_live_ or pk_test_) |
CUSTENA_SECRET_KEY | Seller-side key (starts with sk_live_ or sk_test_) |
CUSTENA_BASE_URL | Override for self-hosted or preview environments |
Next steps
- Generate keys in the dashboard
- Learn about the payment protocols
- Browse the API reference