Supabase Auth → Better Auth
mediumIf you only use Supabase for auth (not the database/storage), Better Auth gives you ownership and removes a vendor. Keep Supabase Postgres if you like it.
Estimated: 4-8h · 5 steps
Progress0%
Step 1: Install Better Auth
npm install better-auth
Step 2: Add auth tables to existing Postgres
Better Auth creates user/session/account tables via its CLI.
npx @better-auth/cli generate
Step 3: Run migration
npx @better-auth/cli migrate
Step 4: Migrate user records
INSERT INTO better_auth users SELECT id, email, ... FROM auth.users. Passwords need rehash unless you add a custom verifier.
Step 5: Replace client calls
supabase.auth.signInWithPassword → authClient.signIn.email(). signOut, getSession map similarly.
✓ Existing users can log in. New sign-ups land in Better Auth tables.