How it works

The architecture, and why the canvas is your own site.

EditorReact SPAYour sitecanvas, in an iframeVisitorsPlatform WorkerAPI, auth, deliveryD1metadataR2contentKVread cacheDurable ObjectpresencepostMessageHTTPS

Three pieces

The platform is a single Cloudflare Worker. It owns the API, authentication, publishing and delivery. Content lives in R2, metadata in D1, the read path is cached in KV, and live presence runs on a Durable Object.

The editor is a React SPA. It holds no content of its own: it reads through the API and drives the canvas over postMessage.

The canvas is your application. The editor loads your site in an iframe from your origin with the editor flag set, and the SDK inside it answers: here are my components, here is where each block rendered, this text was edited.

Why an iframe and not a renderer

The alternative is for the builder to re-implement your components, which means a second version of your design system that drifts from the first. Loading your real site means an author edits the thing that ships. Your CSS, your fonts, your data fetching, your framework version.

The cost is a boundary: the editor and the canvas are different origins, so they talk in messages rather than function calls. Every message is origin-checked against the workspace's registered editor origin, in both directions.

The read path

text
Visitor → your app → fetchOneEntry() → Worker → KV cache → R2

Published content is written once to R2 and cached in KV keyed by environment, URL, and the resolved variant and personalization combination. The cache key includes those dimensions, which is why the editor warns when a page's variant count multiplies past a soft cap: every combination is a separate cached object.

The write path

Drafts autosave to R2 under a draft key. Publishing copies the draft to the published key for the chosen environments, writes a version row, and purges the affected cache keys. A version is a full snapshot, so restoring is a copy rather than a replay of changes.

All documentation · llms.txt · llms-full.txt · contentbind.com