@v402pay/gateway
v0.3.0
Published
v402pay gateway middleware for Express, Fastify, and Next.js
Maintainers
Readme
@v402pay/gateway
Server-side gateway middleware for the v402 payment protocol — intent creation, policy enforcement, on-chain verification, and receipt issuance.
Install
npm install @v402pay/gatewayUsage
import { createGatewayContext, v402GatewayFastify } from "@v402pay/gateway";
const ctx = createGatewayContext(process.env);
const fastify = Fastify();
await v402GatewayFastify(ctx, fastify);
fastify.post("/api/tool", async (req, reply) => {
return reply.send({ result: "Hello from paid tool" });
});Supports Express, Fastify, and Next.js middleware.
