GlobalConfigInput
Defined in: packages/core/src/globals/types.ts:145
User-facing input to defineGlobal().
Mirrors CollectionConfigInput with the same five generics. The constraint
[TFieldSlug & ReservedGlobalFieldKey] extends [never] is enforced in
defineGlobal’s function signature — a compile-time error is emitted if
any field key is _id, _creationTime, or _slug.
Type Param
Section titled “Type Param”TFieldSlug
Union of field key string literals.
Example
Section titled “Example”defineGlobal({ slug: "siteSettings", label: "Site Settings", fields: { siteName: text({ label: "Site Name", required: true }), activeTheme: relationship({ label: "Active Theme", collection: "themes" }), }, admin: { group: "Site Builder" },});- GlobalConfig for the resolved return type
- defineGlobal for the config function
Type Parameters
Section titled “Type Parameters”TFieldMeta
Section titled “TFieldMeta”TFieldMeta extends object = { }
Metadata attached to each field definition.
TGlobalMeta
Section titled “TGlobalMeta”TGlobalMeta extends object = { }
Metadata attached to the global config itself.
TGlobalSlug
Section titled “TGlobalSlug”TGlobalSlug extends string = string
The slug string literal type (inferred by defineGlobal).
TFields
Section titled “TFields”TFields extends Record<string, AdminField<TFieldMeta>> = Record<string, AdminField<TFieldMeta>>
TComponent
Section titled “TComponent”TComponent extends ComponentHKT = ComponentHKT
Component HKT binding.
TDrafts
Section titled “TDrafts”TDrafts extends boolean = false
Properties
Section titled “Properties”admin?
Section titled “admin?”
optionaladmin?:GlobalAdminConfigInput<TComponent,TGlobalSlugextendsstring?TGlobalSlug:string,false>
Defined in: packages/core/src/globals/types.ts:176
Admin panel display and behaviour config.
fields
Section titled “fields”fields:
TFields
Defined in: packages/core/src/globals/types.ts:170
Field definitions for this global. All field types supported by
defineCollection are valid. Field keys must not be _id,
_creationTime, or _slug (enforced at compile time by defineGlobal).
hooks?
Section titled “hooks?”
optionalhooks?:GlobalHooksInput<TGlobalSlugextendsstring?TGlobalSlug:string>
Defined in: packages/core/src/globals/types.ts:172
Lifecycle hooks for this global.
interfaceName?
Section titled “interfaceName?”
optionalinterfaceName?:string
Defined in: packages/core/src/globals/types.ts:184
Override the generated TypeScript interface name. Inferred from slug
with Global suffix when omitted (e.g. "siteSettings" → "SiteSettingsGlobal").
label:
string
Defined in: packages/core/src/globals/types.ts:164
Human-readable label shown in the admin sidebar and page heading.
Always used as the admin page title — globals have no useAsTitle.
Example
Section titled “Example”"Site Settings"
optionalmeta?:TGlobalMeta
Defined in: packages/core/src/globals/types.ts:186
Arbitrary metadata attached to this global config.
slug:
TGlobalSlug
Defined in: packages/core/src/globals/types.ts:158
Unique slug for this global. Becomes the _slug discriminator on the flat
document and the lookup key in vex_globals. Must be camelCase and unique
across all globals in the project.
versions?
Section titled “versions?”
optionalversions?:object
Defined in: packages/core/src/globals/types.ts:192
Draft and versioning config. Parsed but ignored in v35 — versioning for
globals lands in Spec 36. Included now for forward compatibility so
defineGlobal call sites don’t need to change when Spec 36 ships.
autosave?
Section titled “autosave?”
optionalautosave?:object
Debounce background saves to the draft row while the edit form is
open. Ignored when drafts is false.
Default Value
Section titled “Default Value”false
autosave.debounceMs?
Section titled “autosave.debounceMs?”
optionaldebounceMs?:number
Debounce (milliseconds) to autosave after inputs have changed
autosave.enabled
Section titled “autosave.enabled”enabled:
boolean
Enable or disable autosaves to new drafts
drafts?
Section titled “drafts?”
optionaldrafts?:TDrafts
Enable the draft/publish workflow for this collection.
Default Value
Section titled “Default Value”false