Plugins
Content Lock

Configuration

Every content-lock option.

contentLock({
  disabled?: boolean
  order?: number                       // default 1000
  groups?: Array<{
    key: string
    label: string | Record<string, string>
    collections?: string[]
    globals?: string[]
    custom?: string[]                  // custom target keys
  }>
  customTargets?: Array<string | {
    key: string
    label?: string | Record<string, string>
    path?: Path | Path[]               // Path = string | { path: string; match?: 'prefix' | 'exact' }
  }>
  individualSelection?: boolean | { access?: ({ req }) => boolean } // default false
  exempt?: string[]
  retryAfter?: number | 'untilEnd'     // default 3600
  timezone?: boolean | DateField['timezone'] // default true
  localeMap?: Record<string, string>
  editor?: {
    features?: FeatureProviderServer[] | (({ defaultFeatures }) => FeatureProviderServer[])
    converters?: string
  }
  jobs?: false | { queues?: string[] }
  collection?: {
    slug?: string                      // default 'content-locks'
    access?: CollectionConfig['access'] | Access // one function: create, update, delete
    overrides?: (collection: CollectionConfig) => CollectionConfig
  }
  translations?: TranslationsOption
})
OptionDefault
disabledfalseReturn the config untouched, for opting out per environment.
order1000Plugin order. Keep it after plugins that add or change access on your collections.
groups[]What a window can freeze besides everything. See scope.
customTargets[]Things a window can lock besides collections and globals, for your code to check. See custom targets.
individualSelectionfalseRaw collection and global pickers on the window, optionally gated by access.
exempt[]Slugs never frozen, on top of the lock collection, Payload's system collections, and collections marked custom: { contentLock: { exempt: true } }.
retryAfter3600Retry-After seconds, or 'untilEnd' for the seconds until the known end.
timezonetrueTime zone picker on the window's dates, from admin.timezones. Pass Payload's date timezone config to narrow the zones, or false to turn it off. The banner always shows the viewer's local time.
localeMap{}Admin language to content locale, for message locales.
editorExtra Lexical features and their converters for messages.
jobsonJobs integration, when @10x-media/jobs is installed.
collection.slug'content-locks'
collection.accesssigned-in usersWho may read and manage windows: per operation, or one function for create, update and delete. The plugin always narrows update to windows that have not ended.
collection.overridesLast-word override of the generated collection. Ended windows stay read-only even if it replaces access.
translationsPer-key string overrides. See i18n.

Exports

Path
@10x-media/content-lockcontentLock, getContentLockState, isContentLocked, assertContentUnlocked, withoutContentLock, ContentLockedError, isContentLockedError, notEndedWhere, ContentLockTokenFeature, types
@10x-media/content-lock/clientuseContentLock, LocalDate, the admin components
@10x-media/content-lock/rscContentLockHeader, StageFilterBar
@10x-media/content-lock/typesContentLockState, LockWindow, LockStage, and friends
@10x-media/content-lock/i18nkeys, translations

On this page