Skip to content

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.

Record<string, unknown>

The saved document, or {} for one being created.

string

The collection or global being previewed.

Record<string, unknown>

The form’s complete current values.

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.

string | undefined

The preview URL, or undefined when it cannot be resolved yet.