GlobalConfigInput
Defined in: packages/core/src/globals/types.ts:102
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.
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).
TFieldSlug
Section titled “TFieldSlug”TFieldSlug extends string = string
Union of field key string literals.
TComponent
Section titled “TComponent”TComponent extends ComponentHKT = ComponentHKT
Component HKT binding.
Properties
Section titled “Properties”admin?
Section titled “admin?”
optionaladmin?:GlobalAdminConfigInput<TComponent>
Defined in: packages/core/src/globals/types.ts:128
Admin panel display and behaviour config.
fields
Section titled “fields”fields:
Record<TFieldSlug,AdminField<TFieldMeta>>
Defined in: packages/core/src/globals/types.ts:126
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).
interfaceName?
Section titled “interfaceName?”
optionalinterfaceName?:string
Defined in: packages/core/src/globals/types.ts:133
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:120
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:135
Arbitrary metadata attached to this global config.
slug:
TGlobalSlug
Defined in: packages/core/src/globals/types.ts:114
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:141
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.
drafts?
Section titled “drafts?”
optionaldrafts?:boolean
Enable draft/publish workflow. Default: false.