Doc or guide to work with supabase auth with convex?
I am having hard time to figure it out how to setup supabase auth with convex. I am transitioning from clerk auth to supabase and want to integrate it to convex.
Thank you❤️
7 Replies
I am not familiar with Supabase auth. As long as it is compatible with OpenID Connect protocol you should be able to use the following Convex guide for custom auth integration: https://docs.convex.dev/auth/custom-auth
I didn't dive deep into it, but the Supabase docs don't make it super clear if they support this method.
Custom Auth Integration | Convex Developer Hub
Convex can be integrated with any identity provider supporting the
@Indy what about NextAuth.js ? is it compatible with convex?
I think they support OpenID, it will be really helpful to get a guide on this in future if possible
Hey @Abhishek, there were some attempts at using NextAuth, but their story for client-side JWTs isn't very good. The auth integrations that work well right now are Clerk, Auth0, and if you're ok using sessionIDs then sessions and Lucia (but not OAuth). Kinde should also work (there's a PR for it here: https://github.com/get-convex/convex-js/pull/5)
Thanks @Michal Srb, is there any roadmap where Convex releases its own auth system? cuz working with clerk and auth0 is causing so much friction.
Clerk support is also not that active for free users. And I find their nextjs middleware implementation still has a lot of bugs.
And just because of the auth I don't want to switch back to supabase again.
PS: The clerk bug I am talking about https://discord.com/channels/856971667393609759/1203150286437224549
@Abhishek that bug was posted on Friday evening, I'd give Clerk folks some time to get to it this week.
In your case, since you're using Convex, can you avoid using API Routes / Route Handlers and use Convex functions or HTTP Actions instead?
Http action would be more appropriate I guess because the Twitter API calls "/callback" route. btw is it possible with Convex functions?
Let me try this approach Thanks again @Michal Srb
NextAuth might be closer to what you want: https://stack.convex.dev/nextauth
Convex with Auth.js (NextAuth)
Learn how to use Auth.js with your Next.js server and Convex backend to build a full-featured authentication system.