NextAuth.js (Auth.js) vs SuapbaseAuth
Working on a side / portfolio project and I was using Planetscale until they nuked their free tier so i moved to supabase (which i really like so far, no need to spin up drizzle kit studio to edit tables). I was also using Clerk but ran quickly into an issue where i wanted to include all the users related to a query and couldn't easily get user data without having to do multiple queries, one solution would be to use webhooks to "sync" data between supabase and clerk. This led me to supabase auth, useful user management interface, also automatically syncs with a users/profile table if I want thanks to database functions, good cascading options, and also allowed me to use more providers than clerks default 3 (for the free tier at least), after poking around and doing some googling I noticed lots of people recommended next auth / auth.js over supabase auth, however most of the results I found are at least a year old or more and it appears supabase has changed a lot since then. So what are the arguments for NextAuth.js (Auth.js) vs Supabase Auth as of March of 2024 ?
5 Replies
next auth doesnt tie you to a provider
but i would not recommend nextauth/authjs also
i would go for lucia all day every day
Lucia
Lucia documentation
Lucia is an open source auth library that abstracts away the complexity of handling sessions.
if you are deep into supabase, the auth solution feels just fine to use
running a separate auth layer allows you flebility at the cost of not matching with the other tools
What makes you pick Lucia over Auth.js? Just curious. I’m not totally enjoying Auth.js. I just use it because it’s already set up with T3
being maintened, works with multiple frameworks, has a ton of nice integrations