Steps that survive crashes. SQLite to PostgreSQL.
| Package | Description |
|---|---|
| @coji/durably | Core library - job definitions, steps, and persistence |
| @coji/durably-react | React bindings - hooks for triggering and monitoring jobs |
- Resumable — each step's result is persisted; interrupted jobs resume from the last successful step
- Parallel joins — run independent named steps concurrently and replay only unfinished branches after recovery
- Flexible storage — libSQL/Turso, PostgreSQL, better-sqlite3, or browser OPFS
- Browser + server — same API for Node.js and browsers
- Lease-based recovery — stale workers are automatically reclaimed via fencing tokens
- Auto cleanup —
retainRunsoption purges old completed runs automatically - React hooks — real-time progress via SSE, fullstack and SPA modes
- Type-safe — Zod schemas for input/output, labels, and auth context
pnpm add @coji/durably kysely zod @libsql/client @libsql/kysely-libsqlSee the Quick Start guide, or Choosing a Database for PostgreSQL and other backends.
Use Node.js 24 and pnpm 12. The exact versions are declared in package.json; pnpm downloads the development runtime automatically.
pnpm install --frozen-lockfile
pnpm --filter @coji/durably exec playwright install chromium
pnpm validate
pnpm buildpnpm doctor:check scans the React bindings and all four React examples with React Doctor. It requires a complete 100/100 score for each project and also runs as part of pnpm validate and CI. pnpm doctor shows an interactive report. Keep any rule suppression adjacent to the affected line and explain why the behavior is intentional.
Docker must be running for PostgreSQL tests. Alternatively, set DURABLY_TEST_POSTGRES_URL to an existing PostgreSQL instance.
See the dependency migration notes for package-by-package compatibility decisions and validation, and ADR-0002 for runtime and compiler setup.
MIT