
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeHappy Friday! š
I'd be happy to help with the Next.js live preview feature! That guide you linked is indeed excellent for setting up Visual Editing with the Pages Router.
What specific part of the preview setup are you having trouble with? Here are some common areas where people need help:
Common issues with Next.js draft mode and live preview:
Draft mode not activating - Make sure your /api/draft route is properly validating the preview URL secret and setting the draft mode cookie correctly with res.setDraftMode({ enable: true }).
Preview not updating in real-time - You need both:
useLiveQuery hook from next-sanity/preview wrapping your queries on the client sideVisualEditing component from @sanity/visual-editing/next-pages-router added to your _app.tsxLiveQueryProvider wrapping your preview componentsStega encoding not appearing (no clickable overlays) - Ensure your Sanity client is configured with:
perspective: 'previewDrafts' when in draft modestega: { enabled: true, studioUrl: '/studio' }CORS errors - Don't forget to add your local development URL (like http://localhost:3000) to your project's CORS origins in sanity.io/manage.
Presentation tool not loading your preview - Check that the presentationTool plugin in your sanity.config.ts has the correct previewUrl.draftMode.enable path pointing to your draft API route (typically /api/draft).
The key architecture is:
useLiveQuery to subscribe to content updatesThe guide walks through creating separate "preview" components (like PostsPreview.tsx) that use useLiveQuery to wrap your regular components, which is a clean pattern for managing the preview state.
If you can share what specific error message or unexpected behavior you're seeing, I can give you more targeted help! Common symptoms include:
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store