DEV Community

Discussion on: The magic of react-query and supabase

Collapse
 
ankitjey profile image
Ankit Jena

So did you connect nextauth with the supabase postgres instance

Collapse
 
mathewthe2 profile image
Mathew Chan • Edited

I did. Several things I had to do different.

Instead of .env.local, I had to add the supabase environment variables to next.config.js because the client supabase is declared client side instead of server side.

With nextauth I had to do an async call getSession() to request the userId first before querying because the userId isn't exposed to the default session object for security reasons

This was also my first time using Typescript so there were all kinds of issues trying to follow the code to get it working on my own project.

Thread Thread
 
ankitjey profile image
Ankit Jena

That's awesome.