Live Preview and Visual Building in Contentstack
The biggest complaint about headless CMSs: "I can't see what I'm editing." Live Preview and visual editing in Contentstack fix that by rendering your real frontend beside the editor, updating as you type.
How Live Preview Works
- The editor opens an entry
- Contentstack loads your site in a preview panel with a preview token and hash
- Your frontend fetches draft content via the preview API
- Every change in the editor triggers a refresh with the latest content
Setup in Next.js (Outline)
npm install @contentstack/live-preview-utils
import ContentstackLivePreview from '@contentstack/live-preview-utils';
ContentstackLivePreview.init({
stackDetails: { apiKey: process.env.NEXT_PUBLIC_CS_API_KEY, environment: 'preview' },
clientUrlParams: { host: 'app.contentstack.com' },
enable: true,
});
Configure the Delivery SDK with live preview settings and preview token, then enable Live Preview for the environment in stack settings with your site's preview URL. Follow the official guide for your framework version — SSR and SSG setups differ.
Edit Tags
Add edit tags (data attributes) to rendered fields. Editors hover on the preview and click "Edit" to jump straight to the right field. The Delivery SDK can generate these for you.
Visual Builder
Visual building takes it further: editors can select and edit content directly on the page, rearrange modular blocks, and add components — while developers keep control through the content model.
Tips
- Use a separate preview environment and token
- Make sure draft content doesn't get cached by your CDN
- Wire up edit tags for modular blocks so editors can reorder visually
- Test Live Preview as part of every frontend release
Live Preview turns a headless CMS into a confident editing experience. It's the feature editors thank developers for.