Tollstile

Installation

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

Pre-release · planned API
npm install tollstile
PackagePurposeStatus
tollstileCore: quotes, 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
create-tollstileProject template with a paid route and a paying test agentImplemented
@tollstile/x402x402 rail (exact, upto) over HTTP and MCPIn development
@tollstile/mppMPP rails: Stripe, Tempo charge, Tempo sessionIn development
@tollstile/l402L402 (Lightning) railIn development
@tollstile/kyapayKYAPay railIn development
@tollstile/web-bot-authverifiedAgent() via HTTP message signaturesIn development
@tollstile/ap2userMandate() via AP2 mandatesIn development
@tollstile/postgres · @tollstile/sqliteSQL ledgers, bring your own clientIn development
@tollstile/mcp · @tollstile/next · @tollstile/express · @tollstile/fetchAdaptersIn development

Not on npm yet

Packages are published when v0.1 is complete. Until then, build from the repository.

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.

On this page