Skip to content

Content Preview

Content Preview lets you see how a draft page will look on your actual storefront before making it live.

How it works

  1. Alokai CMS generates a short-lived preview token (stored in Cloudflare KV with a TTL)
  2. The editor opens an iframe pointing to your storefront preview URL with the token as a query parameter
  3. The storefront reads the token, calls Alokai CMS’s management API to fetch the draft page, and renders it

Setting up a preview URL

Go to Settings → Content Preview and click New Preview URL. Enter:

  • Name — Label for this preview URL
  • URL — Your storefront’s preview endpoint, e.g. https://storefront.example.com/preview
  • Default — Whether this is the default preview URL for the space

The preview URL receives the token as ?token=<value>.

Using preview in the editor

Click the Preview button in the page editor toolbar. The editor panel collapses and the page renders in a full-width iframe using the configured preview URL.

The preview reflects your current draft — unsaved changes are not included. Save first to see the latest edits.

Preview tokens

  • Tokens are UUID strings stored in KV
  • Default TTL: 3600 seconds (1 hour)
  • Tokens can be revoked early via the API: DELETE /api/preview/{token}
  • Tokens are single-use for a session — a new token is generated each time you open the preview