Replace Replit Auth with Supabase Auth

Replit Auth logs people in with their Replit account. It takes no setup and it only works on Replit. When the app moves to your own server or Vercel, the login has to change. Supabase Auth with email and password is a common choice, and the app keeps its users table.

Your Replit users, on Supabase Auth

Where Replit Auth sits

We read the code of a Replit Agent app from November 2026. The login is spread over these files:

WhereWhat it does
artifacts/api-server/src/lib/auth.tsRuns OpenID Connect against replit.com/oidc with REPL_ID as the client ID
artifacts/api-server/src/routes/auth.tsThe /login, /callback, /logout and /auth/user routes
lib/db/src/schema/auth.tsThe sessions and users tables, marked as mandatory for Replit Auth
@workspace/replit-auth-webThe useAuth hook the web app uses to log in and out

The login provider and the REPL_ID come from Replit. Outside Replit the login has nothing to talk to.

The plan

Keep the users table and its IDs. Projects, tasks and anything else point at those IDs, so they stay valid. Add a column for the Supabase user ID. When someone signs up with an email that is already in the users table, link the new login to that row. Then remove the Replit login code and its routes.

Paste this into your AI tool:

This app logs people in with Replit Auth. Replace it with Supabase Auth, email and password, in my new Supabase project. Keep the users table. When someone signs up with an email that is already in the users table, link the new login to that row. Remove the Replit Auth code and the environment variables only Replit Auth reads. Ask me for the Project URL and the publishable key of the Supabase project. Show me the plan before you change anything.

Claude Code and Codex both answered with a plan along these lines and asked for the Project URL and the publishable key. Both values are safe in a browser. The service_role key is not needed for this, so do not paste it.

Claude Code with its plan to replace Replit Auth with Supabase Auth, asking for the Project URL and the publishable key

Both plans kept REPL_ID itself, because vite.config.ts of a Replit Agent app also reads it for the Replit dev plugins. Only the login stops using it.

Set up Supabase Auth

  • Under Authentication, URL Configuration, set the Site URL to the new address of the app and add it to the Redirect URLs.
  • Keep email confirmation on. Linking by email is only safe when Supabase has checked the address first.
  • The built-in email sender of Supabase only sends to the members of your Supabase team, with a low hourly limit. For real users, set up your own SMTP under Authentication, Emails.

What your users see

Everyone signs in once more. They create a password with the email they used on Replit, confirm it and see their old projects again. Old Replit sessions stop working.

Replit Auth or Supabase Auth

Replit AuthSupabase Auth
LoginA Replit accountEmail and password, or other providers
Works onReplit onlyAny host
UsersYour users table, filled from Replitauth.users in Supabase, linked to your users table
SetupDone by Replit AgentA Supabase project, the URL Configuration and SMTP for real email

Sources

  1. Replit docs: Auth
  2. Supabase docs: Password-based auth
  3. Supabase docs: Send emails with custom SMTP
  4. Supabase docs: Redirect URLs

Read next

Pick your route.

Choose where you are and where you want to go. The guide takes it from there.