type

PreviewToken

One short-lived read-only resource capability.

Properties

PropertyTypeDescription
TokenstringShort-lived bearer secret accepted only by preview reads.
ResourcestringResource kind: collection or global.
SlugstringExact collection or global slug.
DocumentIDstringExact collection document identity; empty for a global.
ExpiresAttime.TimeAbsolute token expiry time.

How it works

The token is read-only and scoped to one exact resource. Treat Token as a bearer secret and pass it only to the intended preview frontend.

Full signature

type PreviewToken struct { Token string Resource string Slug string DocumentID string ExpiresAt time.Time }

Source core/preview.go:22