Set up a Supabase Client in Next.js

Share this video with your friends

Send Tweet

In this lesson, we'll create a new Next.js application, and add the Supabase client to our project. We'll also look at how Supabase authorizes applications using client keys, and cover some things you need to know about securely using Supabase in your applications.

semmi verian
semmi verian
~ 3 years ago

Hi, I have a question, Is it safe to not wrap the onAuthStateChanged to the useEffect block?

Are we going to re-create a multiple listener if we're doing the listener like you do on the video?

Thank you

Steve
Steve
~ 3 years ago

I would like to know the answer to this as well?

Steve
Steve
~ 3 years ago

<code>onAuthStateChanged<code> return a subscription object which can be used to unsubscribe itself.

Shouldn't we be making use of it?