Need help with prisma schema (next-auth --> better-auth) migration
Next.js
Hey all, I've recently tried setting up better-auth in one of my new projects and the whole setup was a breeze.
It encouraged me to migrate one of my other Next.js apps from NextAuth to Better Auth mainly to avoid the cryptic errors I keep getting on sentry every now and then, and for the wider support better-auth is getting.
Current Setup: - NextAuth with JWT strategy (no sessions table) - Google OAuth - Prisma + PostgreSQL - Custom user ID prefix (usrxxx) - Account linking (if user exists with email, link new OAuth provider)
Questions: 1. Can I keep using JWT-only (no sessions table) with Better Auth? 2. Is my existing schema compatible, or do I need to rename/add columns? 3. How do I handle custom user ID generation (usr prefix)?
Migrate from Auth.js to Better Auth in your Next.js app without losing data or functionality. This guide walks you through schema mapping, API updates, and client-side integration.