npm packages are not installable yet: [email protected] can be published after 2026-09-16 10:30 UTC. Details
Tollstile

Installation

Packages, what each one does, and which are available today.

Public Beta · early access
npm install tollstile
PackagePurposeStatus
tollstileCore: quotes, execution plans, idempotency, structured denials, authorizations, charges, flows, reconciliation, access policies (subscriber, credits, payPerCall), requirements (limit, payers, when), test rail, memory ledgerImplemented
@tollstile/honoHono middleware (Node, Bun, Deno, Workers)Implemented
@tollstile/mcpMCP tools on @modelcontextprotocol/sdkImplemented; tested with the real SDK
@tollstile/expressExpress 5 routesImplemented; tested with a real Express app
@tollstile/nextNext.js App Router route handlersImplemented; not yet run inside a Next.js app
@tollstile/fetchWeb-standard handlers: Workers, Deno, BunImplemented; not yet run on Workers, Deno, or Bun
create-tollstileProject template with a paid route and a paying test agentImplemented
@tollstile/x402x402 rail (exact, upto) over HTTP and MCPImplemented; not verified against a live facilitator or chain
@tollstile/mppMPP rails: Stripe charge, Tempo charge, Tempo sessionImplemented; not verified against Stripe or Tempo. Tempo session is experimental
@tollstile/l402L402 (Lightning) railImplemented; not verified against a Lightning node
@tollstile/kyapayKYAPay railImplemented; not verified against Skyfire
@tollstile/web-bot-authverifiedAgent() via HTTP message signaturesImplemented; not verified against a live agent
@tollstile/ap2userMandate() via AP2 mandatesExperimental
@tollstile/postgresPostgres ledger: pg, postgres.js, Neon, PGliteImplemented; tested on PGlite
@tollstile/sqliteSQLite ledger: node:sqlite, better-sqlite3, bun:sqlite, D1Implemented; tested on node:sqlite

Every package is tested against fakes, published test vectors, and reference libraries. None has been verified against live providers yet — real facilitators, chains, Stripe, Lightning nodes, or Skyfire. Each rail's page has a Verification status section with what was tested and how to check it live.

Not installable from npm yet

@tollstile/* 0.1.0 is on npm, but it depends on tollstile, which can be published again only after 2026-09-16 10:30 UTC (as [email protected]). Until then npm install fails with No versions available for tollstile. Build from the repository in the meantime. Install commands in these docs show the published names.

Create an instance

import { createTollstile, memoryLedger, testRail } from "tollstile";

export const toll = createTollstile({
  rails: [testRail()],
  ledger: memoryLedger(),
  // Required with live rails: signs quotes. Use at least 32 random characters.
  // secret: process.env.TOLLSTILE_SECRET,
});
OptionDefaultPurpose
railsRails you accept. Test rails cannot be mixed with live rails.
ledgerWhere authorizations, charges, and claims are recorded.
secretrandom (test rails only)Signs quotes. A list rotates: the first signs, all verify.
quoteTtlMs5 minutesHow long a quote is honored.
providerTimeoutMs10 secondsUpper bound for any provider call.
clocksystem clockInject for tests.
onEventTyped lifecycle events for logs and metrics.

The conformance kit is exported from tollstile/testing, a subpath of tollstile; there is no separate testing package to install.

On this page