Node.js/TypeScript middleware for merchants to intercept API requests and verify on-chain x402 payments.
paynode-sdk-js is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on express, middleware, nodejs, typescript. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like openlibx402, toll-booth, x402-flow-facilitator, middleware-express, x402-openai-typescript, covenant.
[!NOTE] Compatibility policy & legacy header aliases are documented in COMPATIBILITY.md.
The Master SDK for the PayNode Protocol. This JavaScript/TypeScript implementation serves as the Reference Implementation for the x402 V2 protocol. All future SDKs (Python, Go, Rust, etc.) are built following the architectural patterns and logic established in this codebase.
The current baseline and cleanup requirements for turning sdk-js into the formal multi-language source of truth are documented in meta/MULTI_LANGUAGE_BASELINE.md. The protocol source of truth lives in meta/SPEC.md.
PayNode is a stateless, non-custodial M2M payment gateway that standardizes the HTTP 402 "Payment Required" flow for AI Agents, enabling seamless USDC settlement on Base L2.
As the Master SDK, sdk-js defines the gold standard for:
[!TIP] Developers building PayNode SDKs for other languages should treat this repository as the Source of Truth for internal logic and protocol compliance.
npm install @paynodelabs/sdk-js ethers
The PayNodeAgentClient automatically identifies 402 challenges and executes the best settlement path (On-chain or EIP-3009).
import { PayNodeAgentClient } from "@paynodelabs/sdk-js";
// Initialize with Private Key and Base RPC
const client = new PayNodeAgentClient("YOUR_PRIVATE_KEY", ["https://mainnet.base.org"]);
async function main() {
// Automatically handles 402 challenges, settles USDC, and retries the request
const response = await client.requestGate("https://api.merchant.com/premium-data");
const result = await response.json();
console.log("Success:", result);
}
main();
Starting from v2.3.0, the SDK provides a unified middleware for PayNode Market Proxy requests. It handles discovery probes, signature verification, and body unwrap in a single line.
import { PayNodeMerchant } from "@paynodelabs/sdk-js";
import express from "express";
const app = express();
const merchant = new PayNodeMerchant({
sharedSecret: "YOUR_MARKET_SECRET" // Obtainable from PayNode Market Hub
});
// Unified Middleware (Manifest + Auth + Discovery)
app.post("/api/v1/tools", merchant.middleware({
manifest: {
slug: "gpt-researcher",
name: "GPT Researcher",
description: "Research endpoint",
price_per_call: "0.05",
currency: "USDC"
},
price: "0.05" // Also set price directly — manifest.price_per_call is for Market Hub sync only
}), (req, res) => {
// req.body is automatically unwrapped for valid Market Proxy requests
res.json({ result: "Data for " + req.body.query });
}
);
IdempotencyStore for high-frequency replay protection.As the lead SDK, this package drives the protocol forward. Current initiatives:
sdk-js logic to Python for LangChain/AutoGPT integration.cp .env.example .env and set CLIENT_PRIVATE_KEY. If you want to run the merchant demo too, also set MERCHANT_ADDRESS.npx ts-node examples/mint-test-tokens.ts (Base Sepolia).npm run example:servernpx ts-node examples/agent-client.ts| Component | Current Version |
|---|---|
| Protocol (x402) | v2 |
| SDK Implementation | v2.4.0 |
[!IMPORTANT] Protocol and SDK package versioning are not the same thing. Treat the protocol as
x402 v2, and treat2.4.0as the current JS SDK implementation version.
Built for the Autonomous AI Economy by PayNodeLabs.
An open-source library for AI-native x402 integrations in the Solana ecosystem. Built for Python and Node.js, distributed via PyPI and npm, with server implementations for FastAPI and Express.js. Accelerate.
Any API becomes a Lightning toll booth in one line. L402 middleware for Express, Hono, Deno, Bun, and Workers.
x402 payment facilitator for Flow EVM (eip155:747)
Armory x402 SDK — Payment middleware for Express v5. Accept x402 payments from any client in your Express app. 100% compatible with Coinbase x402 SDKs.
Drop-in OpenAI Typescript client with transparent x402 payment support.
The payment rail AI agents use to get paid without human approval. Optimistic settlement on @solana. Jobs auto-finalize after a challenge period, disputed jobs escalate to a bonded arbitrator. One protocol, any agent.
An open SDK for agentic payments. Let AI agents make payments, hold funds, and move money across chains with policy enforcement and human approval built in.
Golang SDK for A2A Protocol
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
Rust SDK for the Machine Payments Protocol
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Opinionated React Native crypto x AI chat app boilerplate with embedded wallet support, conversational AI, and dynamic UI component injection