Skip to content

Setup & entry points

tapedb init provisions one Durable Object class and two R2 buckets in your own Cloudflare account. It also writes tapedb.schema.ts, the Worker, the Wrangler config and the first migration.

Terminal window
npx tapedb init

tapedb dev starts a local database with a development claim route, so the client needs no session while you build. tapedb studio opens a local table browser at http://127.0.0.1:4400.

Terminal window
npx tapedb dev
npx tapedb studio

The generated Worker declares three resources: one Durable Object class, the DATA R2 bucket for log segments and snapshots, and the FILES R2 bucket for uploads. There is no D1 database. Memberships and sessions stay in your identity system; the engine reads one workspace claim.

import contains React
tapedb createClient, schema builders, id no runtime deps
tapedb/schema schema, model, t, role, filter, check no
tapedb/react useLive, useLivePage, usePresence, useBroadcast peer
tapedb/worker defineTapeDB, the Durable Object class no
tapedb/cli init, migrate, dev, studio, deploy no
command does
tapedb init [--dir] [--name] [--force] Write the schema, Worker, wrangler.jsonc, .dev.vars and first migration. Existing files are kept unless --force.
tapedb dev [--dir] [--port] Run the local database with wrangler dev (default port 8787).
tapedb studio [--url] [--workspace] [--port] Open a local table browser (default port 4400).
tapedb migrate dev --name <name> [--rename old=new] [--accept-data-loss] [--dir] [--schema] Write the next migration.
tapedb migrate status | check [--dir] [--schema] List migrations; check fails on unmigrated schema changes.
tapedb deploy [--env] Check ENVIRONMENT, dev claims and migrations, then run wrangler deploy.
tapedb export --workspace <uuid> [--url] [--out] Stream the workspace as NDJSON.
  • A Cloudflare Worker with a Durable Object and two R2 buckets; init generates the bindings.
  • Node.js 20 or later for the CLI.
  • React 19 (optional) for tapedb/react; the core entry stays React-free and has no runtime dependencies.

MIT.

Next: define the schema or read how to deploy migrations.