Skip to content

defineServerConfig

defineServerConfig(props): VexConfig

Defined in: packages/core/src/config/config.ts:250

Layers server-only settings onto an already-resolved VexClientConfig, producing the full VexConfig every server-side and Convex reader consumes.

Validates that every mediaCollection.meta.storageAdapter resolves to a registered adapter instance, and — when an auth adapter is registered — that the auth collections the client config declares match the ones the live adapter produces from the real auth options. The client config builds its authCollections from a schema description it can safely import into the browser; only this function holds the live adapter, so this is where a mismatch becomes an error instead of an admin panel quietly missing a column. Registering the adapter is optional: a project with no auth, or one that prefers to skip the check, simply omits server.auth.

config and the server-only settings to layer on.

VexClientConfig

The resolved VexClientConfig, typically the default export of vex.config.ts.

VexServerConfigInput

Server-only settings: the auth adapter and the storage adapter instances. Nothing else belongs here.

VexConfig

The resolved VexConfig, structurally containing every field of props.config.

When a media collection names an unregistered storage adapter.

When config.authCollections disagrees with the registered auth adapter’s collections.

import config from "./vex.config";
import { betterAuthAdapter } from "@vexcms/better-auth";
export default defineServerConfig({
config,
server: {
auth: { adapter: betterAuthAdapter({ config: authOptions }) },
storage: { adapters: [convexFileStorage()] },
},
});