defineConfig
defineConfig(
config?):VexConfig
Defined in: packages/core/src/config/config.ts:48
Resolves a raw Vex config input into a fully-populated VexConfig.
Applies defaults for any omitted properties — an absent collections
array is replaced with an empty array so downstream consumers can always
iterate without null-checking.
When an auth adapter is provided, its collections are merged with
user-defined collections via mergeAuthCollections. Protected
auth collections cannot be overridden, and locked fields are preserved.
Parameters
Section titled “Parameters”config?
Section titled “config?”The raw Vex configuration supplied by the caller.
Returns
Section titled “Returns”The resolved VexConfig with all defaults applied.
Examples
Section titled “Examples”// Basic config with user-defined collections onlydefineConfig({ collections: [ defineCollection({ slug: "posts", fields: { title: text() } }), ],});// Config with Better Auth integrationimport { betterAuthAdapter } from "@vexcms/better-auth";
defineConfig({ auth: betterAuthAdapter(authOptions), collections: [posts, authors],});- VexConfigInput for the user-facing input type
- VexConfig for the resolved return type
- mergeAuthCollections for auth collection merge logic
- better-auth/src!betterAuthAdapter for the Better Auth adapter