CMS
@tapedb/cms is a content management system that runs inside your TapeDB Worker, in your own Cloudflare account. Content lives in your Durable Objects and R2 buckets; editors work in a studio served by the same Worker, or at /studio on your own site; websites read published content from cached, anonymous routes.

What you get
Section titled “What you get”- Content types in code.
defineContentdescribes your types and fields in TypeScript; each type becomes TapeDB models with migrations you review and commit. - Drafts, revisions, review. Editors work on a draft beside the published document. Publishing writes the next revision; every publish and unpublish leaves an immutable snapshot you can restore.
- Releases and scheduling. Group documents and publish them together in one transaction, now or at a set time, from the Worker’s cron.
- Co-editing. Rich text is either locked to one editor at a time or merged live as several people type.
- A studio. Home, lists, forms, review with word-level change marks, live preview, a media library with focal points, preview links for people without an account, and member management. Every control is the studio’s own and works from the keyboard.
- Your brand, your inputs. Name, logo, colours, fonts and radii; your own field inputs, previews and home panels in
tapedb.cms.tsx. - Delivery. Published documents and images on anonymous routes, cached, with a typed SDK for any website and React components for rich text and images.
- An importer. Records from any system, checked whole before anything is written, re-runnable.
Rules on the server
Section titled “Rules on the server”Everything the studio does, a script or another client can do too, and the same rules apply: TapeDB checks each write inside its transaction. Roles decide who drafts, publishes, schedules and deletes; a published document must be complete and valid; a publish based on an older revision is refused; a strong reference cannot be left dangling; a slug is unique among published documents of its type. The studio hides what a role cannot do, but the server is what refuses it.
| Role | Can |
|---|---|
| user | read published documents |
| member (contributor) | write drafts and release versions, upload images, make preview links |
| editor | publish, unpublish, publish and schedule releases, manage all media |
| admin | delete documents |
| owner | manage members (with TapeDB sign-in) |
Add it to your app
Section titled “Add it to your app”In a project made by tapedb init (TapeDB 0.5 or later):
npx @tapedb/cli add @tapedb/cmsnpx @tapedb/cli migrate dev --name cmsnpx @tapedb/cli devThen open http://localhost:8787/cms. tapedb init --cms does the same for a new project.
add installs the package, lists it under "tapedb": { "extensions": [...] } in package.json and sets the project up:
cms.content.tswith a first content type,post;contentamong the schema’s extensions andcms({ content })among the Worker’s, with their imports;- the
CONTENTR2 bucket, theIMAGESbinding and a one-minute cron trigger inwrangler.jsonc, whichtapedb deploycreates; tapedb/cms-studio.gen.tsin.gitignore.
A second run changes nothing. Code the CLI cannot edit with certainty, such as options built in another file, it leaves alone and tells you what to add. By hand, the whole set-up is two lines:
import { content } from "./cms.content";export default schema({ /* your models */ }, { extensions: [content] });
// worker.tsimport { cms } from "@tapedb/cms/worker";import { content } from "./cms.content";const tapedb = defineTapeDB({ schema, migrations, extensions: [cms({ content })] });The CMS’s models sit beside your app’s, and its file rules cover public/ only; your own models and rules are unchanged. TapeDB serves the CMS’s routes, hands it every content change after the commit, and runs it on the Worker’s cron. There is no webhook, secret or public URL to configure. See Extensions for how that works.
Deploy
Section titled “Deploy”npx @tapedb/cli deploydeploy creates the CONTENT bucket if it is missing, builds the studio extension if there is one, and deploys the Worker with its cron trigger. The studio is at https://<worker>.workers.dev/cms; sign-in follows Sign-in.