Skip to content

LIVE_PREVIEW_COOKIE

const LIVE_PREVIEW_COOKIE: "vex-live-preview" = "vex-live-preview"

Defined in: packages/core/src/livePreview/constants.ts:30

Marker cookie the project’s own middleware sets after verifying a LIVE_PREVIEW_QUERY_PARAM request carries a valid admin session. LivePreviewProvider requires BOTH this cookie and the query param before it attaches a transport listener.

A cookie rather than a request header specifically so the public page stays statically prerenderable: reading a header (next/headers) in a layout opts the whole route out of static generation, which would undo the prerendering the SEO work delivered. The cookie carries no secret — only "1" — and is deliberately readable from script, because the client is what gates on it.