Skip to content
Home / Migrations / Supabase AuthBetter Auth

Supabase Auth Better Auth

medium

If 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.

What this migration involves

Moving from Supabase Auth to Better Auth is rated medium and takes about 4-8h on a typical project. The guide breaks it into 5 steps, 3 of which ship with runnable commands and 1 with a verification check.

FAQ

How long does migrating from Supabase Auth to Better Auth take?

Around 4-8h for a typical project — 5 steps, difficulty rated medium, 3 of them with copy-paste commands.

Is moving from Supabase Auth to Better Auth reversible?

No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your Supabase Auth data before you start.

What does Better Auth cost compared to Supabase Auth?

Better Auth: open-source from $0/mo, free plan available.