Skip to content

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.

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" },
});

TFieldMeta extends object = { }

Metadata attached to each field definition.

TGlobalMeta extends object = { }

Metadata attached to the global config itself.

TGlobalSlug extends string = string

The slug string literal type (inferred by defineGlobal).

TFieldSlug extends string = string

Union of field key string literals.

TComponent extends ComponentHKT = ComponentHKT

Component HKT binding.

optional admin?: GlobalAdminConfigInput<TComponent>

Defined in: packages/core/src/globals/types.ts:128

Admin panel display and behaviour config.


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).


optional interfaceName?: 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.

"Site Settings"

optional meta?: 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.


optional versions?: 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.

optional drafts?: boolean

Enable draft/publish workflow. Default: false.