Skip to content

Examples

Runnable quickstart and typechecked application compositions.

Updated

End-to-end composition guides

For architecture, durable handoffs, and diagrams of failure and recovery, start with:

See composition design for how to choose object boundaries and recovery paths.

Source examples

The repository’s examples/ workspace is typechecked with the libraries. The getting-started example is self-contained. The other examples are integration recipes and may need application authentication, external service bindings, R2/KV resources, or build-time wiring before deployment.

Example Demonstrates Source
Getting started Self-contained word-count jobs, stable IDs, HTTP acceptance, and result lookup Worker
Image jobs Operation registration, upstream idempotency keys, result polling, and terminal failures Worker
Subscription renewals Shared scheduler, named alarms, and operation chaining Worker
Email queue Routing, independent fanout, archive storage, DLQ, and redrive Worker and Vite config
Event topics Retained log, consumer positions, retention, and cold storage Worker
Realtime todos Authenticated socket boundary, typed RPC, events, and TanStack DB Worker and browser client
Job dashboard Tracking across objects, fanout push, and RPC handles that wait Worker
Account concurrency Semaphore holder, admission queue, and permit lifecycle Worker
RPC transforms Typed caller/callee wrapping and context propagation Worker

Read each example’s configuration and the repository example catalog for required bindings. Example snippets are not a promise that an external side effect is exactly once.

Validate examples locally

From the repository root:

pnpm install
pnpm build
pnpm --filter durability-examples typecheck

The typecheck verifies API usage, not service credentials, production resources, or external business behavior. The library’s unit and Worker integration tests run separately:

pnpm --filter durability test

Worker integration tests run locally through @cloudflare/vitest-pool-workers without Cloudflare credentials.

Type to search…

↑↓ navigate↵ selectEsc close