resolveLivePreviewUrl
resolveLivePreviewUrl(
props):string|undefined
Defined in: packages/react/src/livePreview/LivePreviewPanel.tsx:461
Resolves the preview URL for the current form values.
ALWAYS appends ?vexLivePreview=1: that param is what the project’s
middleware gates on before it verifies the session and sets the
vex-live-preview marker cookie, and what LivePreviewProvider then
requires to attach a transport listener. A resolver returning a bare public
path would otherwise render a perfectly normal page that never listens.
Temp-id params are appended on top, only while the document is unsaved.
Parameters
Section titled “Parameters”baseDoc
Section titled “baseDoc”Record<string, unknown>
The saved document, or {} for one being created.
collectionSlug
Section titled “collectionSlug”string
The collection or global being previewed.
formValues
Section titled “formValues”Record<string, unknown>
The form’s complete current values.
tempId?
Section titled “tempId?”string
The client-generated temp id for an unsaved document.
LivePreviewUrl | undefined
A literal path, or a resolver cast down at the call site
to the loose LivePreviewUrlResolver default.
Returns
Section titled “Returns”string | undefined
The preview URL, or undefined when it cannot be resolved yet.