VetoVetoDocs
SDK · CLI · MCP

HTTP adapters

Mount a checkout handle on node:http, Express, Hono, or Next.js — one line each — or call the handle directly with no HTTP at all.

The SDK ships thin adapters that serialize the handle over your framework of choice. Each is a separate subpath export so you only pull in what you use.

import { createNodeServer } from '@veto-protocol/checkout/http';

createNodeServer(checkout).listen(8080);
import express from 'express';
import { vetoCheckoutRouter } from '@veto-protocol/checkout/express';

const app = express();
app.use(vetoCheckoutRouter(checkout)); // express is an optional peer dep
app.listen(8080);
import { Hono } from 'hono';
import { vetoCheckoutHono } from '@veto-protocol/checkout/hono';

const app = new Hono();
app.route('/', vetoCheckoutHono(checkout));

The Next adapter is an App Router catch-all. Mount it at app/agent/[...veto]/route.ts so the captured segments map back to the protocol's /agent/... paths:

// app/agent/[...veto]/route.ts
import { vetoCheckoutNext } from '@veto-protocol/checkout/next';
import { checkout } from '@/lib/checkout';

export const { GET, POST } = vetoCheckoutNext(checkout);

The manifest and JWKS live at /.well-known/*, which the app/agent/[...veto] catch-all does not cover. Serve them from their own routes (app/.well-known/agentic-checkout.json/route.ts and app/.well-known/jwks.json/route.ts) using checkout.manifest() and checkout.receiptJwks(), or use a framework whose mount is at the domain root.

createCheckout() returns a handle you can call directly — from your own framework or a serverless function:

const created = await checkout.createSession({ agent_id, items: [{ sku, qty }], rail: 'mock' });
const settled = await checkout.settle(created.body.session_id, { payment });

Export map

Import pathWhat
@veto-protocol/checkoutThe SDK barrel (createCheckout, presets, rails, REASON, …).
@veto-protocol/checkout/http (= /node)node:http server adapter.
@veto-protocol/checkout/handlerThe framework-agnostic core handler.
@veto-protocol/checkout/expressExpress router.
@veto-protocol/checkout/honoHono app.
@veto-protocol/checkout/nextNext.js route handlers.
@veto-protocol/checkout/mcpThe buyer-side MCP server.

All adapters serve the same routes — including /.well-known/agentic-checkout.json and /.well-known/jwks.json — so the manifest and your verifying key are published automatically.

On this page