One domain, no guessing
mywebsite.comis always the cached live site.mywebsite.com/adminalways edits the draft.mywebsite.com/preview/<token>/…renders the draft on your real Next.js site (noindex).
There is no separate staging subdomain. You always know whether you are looking at draft or live.
The workflow
- Edit entries in
/adminor let your connected MCP client draft changes viaentry_update. - Open the preview link from the Publish tab (or ask your agent for
preview_link). - Review the exact list of changed entries (
changes_list) and click Publish. - The backend validates every draft entry against your JSON Schema, atomically promotes draft to live inside Turso, and enqueues a
headcode.publishedevent in its Pub/Sub outbox. - The outbox worker sends an HMAC-SHA256-signed
POST(x-mstack-signatureandx-mstack-timestamp) to/api/revalidate, refreshing Next.js'use cache'within seconds.
Share and rotate the preview link
Anyone with the preview URL can review the draft without creating an account. Tokens do not expire automatically because stakeholders bookmark them. If a link leaks, rotate it once in /admin or via preview_rotate and the old URL stops working immediately.
Snapshots and rollback
Every publish stores the previous live state as a versioned snapshot (the ten latest are retained). Rolling back restores a snapshot without wiping your current draft, and creates a new snapshot so even a rollback is undoable.
Discard the draft
Want to throw away unfinished edits? Run draft_reset (or click Reset in /admin). Live content is untouched.