Server-side Live Preview is for frameworks that support Server Components. For client-side frameworks, use client-side Live Preview.
window.postMessage event that your frontend uses to refresh the route. In Next.js, router.refresh() hydrates the page with fresh data from the Local API.
React
For server-side React applications such as the Next.js App Router, useRefreshRouteOnSave from @frogbotai/live-preview-react.
pages collection with title and slug fields. Authenticate the visitor before reading drafts, and enforce the collection’s read access with the authenticated request. The frontend route must be protected even when it is normally opened inside the Admin Panel iframe.
RefreshRouteOnSave accepts these props:
Building your own router refresh component
Use@frogbotai/live-preview to integrate another framework or routing system.
Troubleshooting
Updates are slower than client-side Live Preview
Server-side Live Preview refreshes only after a document is saved, while client-side Live Preview reacts to form state. Enable Autosave and reduceversions.drafts.autosave.interval when appropriate:
Iframe refuses to connect
If your frontend’s Content Security Policy prevents the Admin Panel from embedding it, allow the Admin Panel domain withframe-ancestors: