Compare
Clerk vs Supabase Auth when sign-in is what broke
The generator picked one. The next prompt offers to replace it. Read which user id your policies expect before you swap the login form. The two products do not share a session, a user id, or a component.
Last verified Oct 23, 2026
What you are actually calling
Supabase Auth is the sign-in that ships with a Supabase project. The user lives in that project. A request that carries the user's session makes auth.uid() the user's UUID inside Row Level Security. The database, storage, and auth are one project. Supabase vs Firebase is the page for when the other backend is Firestore. This page is Clerk against Supabase Auth.
Clerk is a separate user directory and a set of React components. <SignIn />, <SignUp />, <UserButton />, and <Show> are Clerk's. ClerkProvider wraps the tree. auth() from @clerk/nextjs/server reads the session on the server, and it is async: await auth(). Clerk does not create your Postgres tables. If the data is in Supabase, you connect them on purpose. Clerk's integration guide says that connection does not copy user rows. A webhook is how profile data gets into a table.
When each one fits
Stay on Supabase Auth when the failing call is already /auth/v1, the policies use auth.uid(), and the form is a few functions you can read. Lovable Cloud is Supabase-shaped. A generated app in that world is already on this side. Replacing it with Clerk rewrites the user id under every policy.
Pick Clerk when you want the sign-in screen, the user button, and organizations without building them, and you are fine with the user record living at Clerk. The database can be Supabase, Prisma, or something else. Pick Clerk plus Supabase, not Clerk plus supabase.auth.signIn for the same person. Two login systems means two sessions, and the policy will trust only one of them.
Supabase's third-party auth guide says Clerk can sit in front of a Supabase project, alongside Supabase Auth or instead of it. The path they document now is third-party auth, not the older JWT template. That template was deprecated on April 1, 2025. It shared the project's JWT secret with Clerk. Do not add it back. Activate Clerk's Supabase integration so session tokens carry role: authenticated, then add Clerk as a provider in the Supabase dashboard with the Clerk domain.
The sign-in UI
Clerk's quickstart is the components. On Next.js 16 with cacheComponents: true, <Show> and a server auth() read the request, so they need a <Suspense> boundary or the build fails while prerendering. That failure is not the same error as Clerk missing clerkMiddleware(). Both are on auth() was called but Clerk can't detect usage of clerkMiddleware().
Supabase Auth's server guide gives you signInWithPassword, signInWithOAuth, and signUp. You build the form. There is no required hosted <SignIn />. A blank screen after login is usually the session cookie, not a missing component: auth session missing after refresh. Invalid Refresh Token: Refresh Token Not Found is the dead cookie: that page.
RLS and auth.uid()
With Supabase Auth, auth.uid() is the UUID from auth.users. A policy for rows that person owns is auth.uid() = user_id on a uuid column. Grants and policies are two checks. The pages for those failures are RLS disabled in public and RLS blocks the insert.
Clerk user ids are strings, not those UUIDs. Clerk's Supabase guide says auth.uid() is the wrong check. Read the Clerk subject from the session token. The column is text. The policy they publish is auth.jwt()->>'sub' compared to user_id. Leaving auth.uid() = user_id in place after the switch returns no rows. The app looks empty. That is a policy mismatch, not a paused project.
create table public.tasks (
id serial primary key,
name text not null,
user_id text not null default auth.jwt()->>'sub'
);
alter table public.tasks enable row level security;
create policy "users read own tasks"
on public.tasks
for select
to authenticated
using ((select auth.jwt()->>'sub') = user_id);The browser client has to send the Clerk session token. Clerk's guide uses accessToken on createClient, returning session.getToken() with no JWT template name. On the server that is (await auth()).getToken(). The key in the client is the publishable key, the one that used to be called the anon key. It is not the service role key and not Clerk's secret key.
Organizations are a Clerk feature. Supabase does not ship an org switcher. A policy can read organization claims off the Clerk token with auth.jwt(). Use the claim names Clerk's current session-token docs list. Do not invent a column called org_id and expect auth.uid() to fill it.
The Next.js file in front of the route
Next.js 16 renamed middleware.ts to proxy.ts. The warning is The "middleware" file convention is deprecated. Please use "proxy" instead. The file sits next to app/, inside src/ when you use src/. The steps are the proxy rename. Proxy runs on Node.js. export const runtime = 'edge' is rejected there.
Clerk's quickstart says the file is proxy.ts on Next.js 16 and middleware.ts on Next.js 15 and earlier. The body is export default clerkMiddleware() plus the matcher. If auth() cannot see that middleware, the file is in the wrong folder or the matcher skipped the route.
Supabase's file is the session refresh: getUser(), then return the response that setAll wrote cookies onto. The export has to be the one Next.js calls, proxy on Next.js 16. A function still named middleware inside proxy.ts does not refresh, and the next error is a missing session or a refresh token Auth has already thrown away.
What the bill is shaped like
This is not a price list. Amounts and included quotas change. The pages to read are Clerk's pricing page and Supabase's pricing page. What follows is the shape of those pages on Oct 23, 2026.
Clerk's plans are Hobby, Pro, Business, and Enterprise. Hobby is the free plan. Clerk bills monthly retained users: a person who comes back after the day they signed up, which is not the same counter as Supabase's monthly active users. The prebuilt sign-in components are on Hobby. The Pro column is where that page lists removing Clerk branding, multi-factor authentication, and a custom session lifetime. Hobby lists a fixed session lifetime instead.
Supabase Auth is part of the project plan, not a second subscription. The plan names on the pricing page are Free, Pro, Team, and Enterprise. Each includes a monthly active user allowance. Paid plans are where overage past that allowance shows up. Basic multi-factor authentication is listed on Free. Phone multi-factor and SAML are not. A Free plan project can be paused for inactivity. That failure mode is paused or unreachable, which Clerk does not do, because Clerk is not hosting the database.
Using Clerk as the login in front of Supabase is third-party auth on the Supabase project. Supabase's pricing page lists third-party monthly active users on the same plan table as Supabase Auth users. You can owe Clerk for the directory and Supabase for the database and those third-party users. One product's free allowance does not cover the other invoice.
What you redo if you switch
Sessions do not move. People sign in again. Neither guide gives you a way to paste the other product's password hashes into sign-in. Social login means they use that provider again. Organizations, multi-factor enrollments, and Clerk's user button do not appear because you pointed the app at Supabase, and a Supabase auth.users row does not become a Clerk user because you installed @clerk/nextjs.
From Supabase Auth to Clerk, every policy written as auth.uid() = user_id stops matching. Store the Clerk sub in a text column, rewrite the policies, and backfill or abandon the old UUID rows. Clerk's guide is explicit that the integration does not synchronize users. Add proxy.ts with clerkMiddleware() and wrap the app in ClerkProvider. Delete the Supabase sign-in form, or you now have two logins.
From Clerk to Supabase Auth, delete clerkMiddleware() and the Clerk components, and write the form against @supabase/ssr. Policies go back to auth.uid() on uuid columns. Rows keyed by a Clerk user_… string are not Supabase user ids. The refresh cookie has to be written in proxy.ts, or the session disappears on the next request.
When the broken app should stay where it is
Stay on Supabase Auth when the thrown text is Auth session missing, Invalid Refresh Token, or an RLS error, and the project URL is already supabase.co. Stay on Clerk when the thrown text is clerkMiddleware() or a Clerk key, and the components on the page are Clerk's. Switching products deletes the path that just failed and leaves the rows keyed to the old id. One error, one change. The sequence is the fix-loop guide. The full list of fixes is the error index.