Installation
Packages, what each one does, and which are available today.
Pre-release · planned API
npm install tollstile| Package | Purpose | Status |
|---|---|---|
tollstile | Core: quotes, authorizations, charges, flows, reconciliation, access policies (subscriber, credits, payPerCall), requirements (limit, payers, when), test rail, memory ledger | Implemented |
@tollstile/hono | Hono middleware (Node, Bun, Deno, Workers) | Implemented |
create-tollstile | Project template with a paid route and a paying test agent | Implemented |
@tollstile/x402 | x402 rail (exact, upto) over HTTP and MCP | In development |
@tollstile/mpp | MPP rails: Stripe, Tempo charge, Tempo session | In development |
@tollstile/l402 | L402 (Lightning) rail | In development |
@tollstile/kyapay | KYAPay rail | In development |
@tollstile/web-bot-auth | verifiedAgent() via HTTP message signatures | In development |
@tollstile/ap2 | userMandate() via AP2 mandates | In development |
@tollstile/postgres · @tollstile/sqlite | SQL ledgers, bring your own client | In development |
@tollstile/mcp · @tollstile/next · @tollstile/express · @tollstile/fetch | Adapters | In 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,
});| Option | Default | Purpose |
|---|---|---|
rails | — | Rails you accept. Test rails cannot be mixed with live rails. |
ledger | — | Where authorizations, charges, and claims are recorded. |
secret | random (test rails only) | Signs quotes. A list rotates: the first signs, all verify. |
quoteTtlMs | 5 minutes | How long a quote is honored. |
providerTimeoutMs | 10 seconds | Upper bound for any provider call. |
clock | system clock | Inject for tests. |
onEvent | — | Typed lifecycle events for logs and metrics. |