Thread Docs

Examples & starters

Runnable reference integrations — the Wanderlog sample app, the SDK allow/deny demo, and type-checked snippets.

Three ways to see a working integration before (or while) writing your own. All of them live in the Thread monorepo and run against a local stack.

Wanderlog — full sample app

apps/demo-merchant is a fake travel-receipts app that integrates Thread end-to-end: Connect button → hosted consent → callback → code exchange → gateway read → signed webhook delivery. One Fastify file (~250 lines) using @jointhread/sdk, no frontend framework.

pnpm install
pnpm --filter @thread/demo-merchant dev   # http://localhost:4000

Register it in the developer console (http://localhost:3003/apps) with redirect URI http://localhost:4000/callback and webhook http://localhost:4000/webhook, export the four credentials it prints, and walk the whole flow on your laptop. The full setup is in apps/demo-merchant/README.md.

This is the fastest way to see what your users will experience — including the consent screen, scope narrowing, and what a denied read looks like.

SDK allow/deny demo

packages/sdk-ts/scripts/demo.ts is a minimal script that exercises the permission engine through the gateway: one read inside the grant (allowed), one outside it (denied with ThreadDeniedError).

pnpm --filter @jointhread/sdk demo

It needs the local stack up (docker compose up -d, api + gateway dev servers) and THREAD_API_KEY / THREAD_CONNECTION_ID in the environment — the script's header walks you through it.

Type-checked snippets

Every SDK snippet in these docs comes from apps/landing/snippets/sdk-examples.ts, which compiles against the real @jointhread/sdk on every pnpm typecheck. If you want a copy-paste starting point that is guaranteed to match the current SDK surface, start there.

Clickable product prototype

docs/demo is a standalone Next.js prototype that simulates the product journeys (end user, builder, admin) with no backend — useful for seeing the intended UX of flows you haven't built against yet. npm install && npm run dev inside the folder.