Skip to main content
Preview links allow accessing components and content via a shareable token without requiring an API key. This enables sharing draft work with stakeholders, testing components in isolation, and previewing unpublished content.

Authentication

Preview queries use a preview-token header instead of x-api-key:
For WebSocket subscriptions:

Preview Query

Parameters

ParameterTypeDescription
tokenString!Preview link token
versionIntOptional: specific component version

Component Preview

Fetch a component preview (defaults to latest draft):
Response:

Specific Version

Fetch a specific published version of a component:
Variables:

Content Preview

Fetch a content preview:

Preview Subscription

Watch for real-time updates to previewed components or content:
Subscriptions are only useful for draft components and unpublished content, as published versions are immutable.

Client Implementation

React Hook Example

WebSocket Setup for Previews

Handling Large Payloads

When content exceeds the 100KB WebSocket limit:
  1. The component or content field will be null
  2. The resolvedRef is always included
  3. Fetch the full data separately using the component/content ID

Error Handling

Invalid Token

Version Not Found

Preview Resource Deleted