Framework selector
Choose a backend recipe. Every runtime uses the same native ATM flow: capture an attempt, create checkout, reconcile canonical status and fulfil once.
Compatible with the closed-beta ATM app APIs and versioned ATM event headers. Check atm-api-version on every webhook or XRPC receiver event.
Choose a runtime
ATM docs are API-first. The framework recipes below all teach the same native test checkout in the same order: install the SDK, configure durable attempts, create checkout from a trusted backend, verify a webhook or XRPC receiver event, reconcile canonical status, and run a local test.
Full-stack route handlers for checkout and webhooks.
Open guideHonoLightweight Hono route handlers for AT Protocol-style app servers.
Open guideCloudflare WorkersWorkers-style fetch handlers and durable idempotency guidance.
Open guideExpressRaw-body HTTP webhook verification for Express apps.
Open guideFastifyFastify route shape and raw-body verification notes.
Open guideGeneric Node HTTPLowest-common-denominator server contract for agents and custom servers.
Open guideArchitecture first
ATM is framework-agnostic. The durable integration is the server contract: capture an attempt, create checkout from a trusted backend, redirect to ATM-hosted checkout, reconcile canonical status from a worker, and treat verified notifications as wake-ups. Next.js is one example of that architecture, not the architecture itself.
Server first
Service-auth, attempts, status tokens, webhook secrets, buyer assertions and fulfilment stay on your backend.
Client light
Browsers show app UX, call your backend for a checkout URL, and return from checkout; they never hold a status token.
Canonical status
Authenticated status polling drives fulfillment. The default XRPC receiver or compatibility webhook wakes reconciliation; browser returns are only UX hints.
Framework optional
Next.js, Express, Fastify, Hono, Workers, Go, or Python can all implement the same flow.
Portable backend contract
Every native ATM integration, regardless of framework, has the same six server-side steps.
- 01
Create app order
Store the order, its unique attempt ID and the exact native request once, bound to the buyer’s session.
- 02
Capture
On an authorized Buy, save the request and idempotency key durably before contacting ATM.
- 03
Create checkout
POST createCheckout with fresh service-auth, save the response, and return only the checkout URL.
- 04
Verify event
Verify canonical XRPC receiver service-auth or compatibility webhook signatures, then queue a wake-up.
- 05
Reconcile
A worker POSTs getCheckoutStatus with the saved token until the status is terminal.
- 06
Fulfil once
On completed plus fulfil, insert the effect key and grant the purchase in one transaction.
Runnable starters
Each starter runs native test checkout with durable attempts, background status and signed HTTP notifications. Start from the one that matches your framework, or from a recipe on this page.
| Next.js starter | examples/atm-next-starter - native test checkout on Next.js route handlers, a Postgres attempt store you connect, and a cron-triggered status sweep. |
|---|---|
| Hono / Workers starter | examples/atm-hono-worker-starter - native test checkout on Cloudflare Workers, a D1 attempt store, a Cron Trigger status sweep and a local Node runner. |
| Generic Node starter | examples/atm-node-app - native test checkout, private durable attempts, background status and signed HTTP. |
What to copy
- Server-only attempt setup bound to your assigned test configuration.
- Capture before contacting ATM, and recover with the same attempt ID on every retry.
- Native createCheckout with your order ID in private metadata.
- Raw-body webhook verification, or receiver service-auth verification.
- Delivery claims, completed only after the wake-up is durably queued.
- A reconciliation worker that grants each purchase once, by effect key.
- The same boundaries if you port a recipe to another backend stack.
What to replace
- Mint service-auth through your app account’s PDS, with a new token for every call.
- Replace declared helpers and in-memory stores with your database, using compare-and-swap.
- Replace app.example URLs with your registered HTTPS app origin.
- Replace the illustrative DIDs and refs with your assigned test configuration and catalog.
- Pin the native SDK build supplied for your integration and review its changelog before updating.