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 path | What |
|---|---|
@veto-protocol/checkout | The SDK barrel (createCheckout, presets, rails, REASON, …). |
@veto-protocol/checkout/http (= /node) | node:http server adapter. |
@veto-protocol/checkout/handler | The framework-agnostic core handler. |
@veto-protocol/checkout/express | Express router. |
@veto-protocol/checkout/hono | Hono app. |
@veto-protocol/checkout/next | Next.js route handlers. |
@veto-protocol/checkout/mcp | The 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.
createCheckout()
The SDK's front door. Resolves a sparse merchant config into a fully-defaulted checkout handle whose methods map 1:1 to the wire endpoints and MCP tools.
CLI
The veto CLI — login, scaffold a merchant, manage policy, and drive any protocol-speaking merchant (discover, catalog, quote, pay, status, receipt verify). Zero dependencies, runs on Node ≥ 22.6.