Authentication
Production authentication setup
Set the Auth Secret
Ensure BETTER_AUTH_SECRET is set both in Vercel and in your Convex environment. Use a fresh random value for production:
openssl rand -base64 32Configure Production URLs
Better Auth builds callback and verification URLs from your domain. Make sure NEXT_PUBLIC_APP_URL is your real production URL so email links and redirects point to the live site.
Seed the Admin
Visit https://yourdomain.com/en/admin/login after deploying and click Initialize to seed the admin account. Then change the default password from the admin Settings page.
Enable Better Auth Analytics (Optional)
@better-auth/infra is pre-installed. Once the app is live on a public URL, add your BETTER_AUTH_API_KEY to enable analytics. Do this only after deployment - the plugin requires a reachable public URL.
Every notebook, source, message, and study tool is scoped to its owner via an
ownerTokenIdentifier, keeping each student's data private - including
per-user chat threads even when a notebook is shared publicly.