Preview and drafts

Seeing unpublished content, and sharing it with people outside.

Draft mode

tsx
import { fetchOneEntry, isPreviewing, getPreviewToken } from '@contentbind/sdk'
import { cookies } from 'next/headers'

const jar = await cookies()
const entry = await fetchOneEntry({
  model: 'page',
  publicKey: KEY,
  url,
  preview: isPreviewing(jar),
  previewToken: getPreviewToken(jar),
})

With preview set, delivery returns the draft and skips the cache entirely.

A preview link lets someone read a draft with no account: a designer, a legal reviewer, a client. Links can carry a password and an expiry, and can be revoked. The token grants one entry, not a workspace: it cannot be pointed at another page.

All documentation · llms.txt · llms-full.txt · contentbind.com