Prompt
cms preview webhook sdk
Latest observation
Oct 20, 2026
OpenAI APIWeb search: off
If you mean “CMS preview webhook SDK”, the exact answer depends on the CMS/platform and framework, but the general idea is:
- A preview webhook is an endpoint your app exposes.
- Your CMS calls it when draft content changes.
- Your app then revalidates / refreshes preview data or builds a preview URL.
Common SDKs / patterns
1) Next.js + CMS preview webhook
Usually handled with a webhook route, not a special SDK:
- Next.js App Router:
app/api/preview/route.ts - Use the CMS webhook to trigger:
- preview mode
- on-demand revalidation
- draft fetching
2) Sanity
Sanity has strong preview support:
@sanity/preview-kitnext-sanity- webhook-based revalidation
3) Contentful
Common tools:
- Contentful webhooks
contentful-management- Next.js preview/revalidation endpoints
4) Strapi
- Webhooks are built in
- Preview often handled in app code
- Sometimes via plugins or custom middleware
5) Sanity / Storyblok / Prismic / DatoCMS
These often provide:
- preview helpers
- webhook integrations
- SDKs for fetching draft content
Typical preview webhook flow
- Editor saves draft in CMS
- CMS sends webhook to your endpoint
- Your endpoint verifies signature/token
- Your app refreshes cache or enables preview
- User sees draft content in preview
Example webhook endpoint idea
export async function POST(req: Request) {
const secret = req.headers.get("x-webhook-secret")
if (secret !== process.env.WEBHOOK_SECRET) {
return new Response("Unauthorized", { status: 401 })
}
// trigger revalidation / preview update here
return Response.json({ revalidated: true })
}
If you want an actual SDK recommendation
Tell me:
- which CMS you use
- which framework you use (Next.js, Nuxt, Remix, etc.)
- whether you want draft preview or just cache revalidation
and I can give you the exact SDK/package and setup.