Next.js, Supabase/ssr & OAuth. Am I Doing This Right? : Supabase
I have an app that is built on the app router in Next.js. I have Discord login/signin currently enabled with Supabase Auth. I just "migrated" everything over to "supabase/srr" and I have it all working. I can connect, login and logout, and all seems to be working. However, the part I am trying to get my head around is accessing a signed in user across my app. In the past I have just used React (not Next.js) and have used the useContext hook to grab logged in user details across my app. I need a couple of things explaining if anyone can help me get an understanding of this: With Next.js I can't use useContext like I have with standard React, as I get errors in relation to "use client" and server side components. Having looked through the docs on ssr, am I right in thinking that once the login and session is created, to access the user on any "client" component, I just need to create a browser client each time like this: const supabase = createBrowserClient( process.env.NEXT_PUBLIC_SUPAB
Reddit - Please wait for verification
Explore this link on the map →related reading
- Cursor Docs — Agent, Rules, MCP, Skills & CLIdocs.cursor.com
- Building a single-page application with Next.js and React Routercolinhacks.com
- Getting Started: Fetching Data | Next.jsnextjs.org
- Getting Started: Fetching Data | Next.jsnextjs.org
- Getting Started: Error Handling | Next.jsnextjs.org
- projects, claire wangclairebookworm.com
- The logo soup problem (and how to solve it) | Sanitysanity.io
- App Router: Navigating Between Pages | Next.jsnextjs.org
- The Content Operating System for the AI era | Sanitysanity.io
- Getting Started: Server and Client Components | Next.jsnextjs.org
- TITLES | Your Creative Studiotitles.xyz
- Getting Started: Layouts and Pages | Next.jsnextjs.org