Convex + Better Auth
Migrations

Migrate to 0.12

Migrate to @convex-dev/better-auth@0.12

Upgrade

Install dependencies

Update Better Auth and the component. Better Auth must be on 1.6.9 or later in the 1.6.x line.

npm install @convex-dev/better-auth@^0.12.0
npm install better-auth@~1.6.9

Breaking changes

set baseURL for client-side frameworks

If your app uses the cross-domain plugin (e.g., Vite SPA, Expo Web), add baseURL to your betterAuth() options. Without it, Better Auth 1.6 logs a "Base URL could not be determined" warning on every request.

betterAuth({
  baseURL: process.env.CONVEX_SITE_URL, 
  // ...
});

Next.js and TanStack Start setups already set baseURL and are not affected.

Review breaking changes in Better Auth 1.6

Be sure to review the Better Auth 1.6 release post for other breaking changes that may affect your app.

Local Install additional steps

The following steps are only necessary for apps using Local Install.

Regenerate schema

Whenever updating Better Auth with Local Install, regenerate the schema.

The Better Auth CLI is now invoked as npx auth generate instead of npx @better-auth/cli generate.

cd convex/betterAuth
npx auth generate