Skip to content

diffAuthCollections

diffAuthCollections(props): string | null

Defined in: packages/core/src/config/diffAuthCollections.ts:24

Compares the auth collections a client config declares against the ones a live auth adapter produces, and describes the first divergence.

The client config declares its auth collections by calling its auth package’s builder (e.g. betterAuthCollections() from @vexcms/better-auth/client), which cannot see the server’s real auth options. defineServerConfig can: it holds the live adapter. This function is how that advantage becomes an error message instead of an admin panel quietly missing a column.

Comparison is structural over a stable serialization — object key order differs between the two construction paths, and function-valued or undefined properties are dropped, mirroring JSON.stringify, because a declared collection is plain data while a live one may carry callbacks that never affect what the admin renders.

AuthCollectionConfig[]

config.authCollections, as built in vex.config.ts.

AuthCollectionConfig[]

auth.adapter.collections, derived from the real auth options.

string | null

A human-readable description of the first divergence, or null when the two agree.