How the pieces connect
The @supabase/ssr package stores the session in cookies so Server Components and browser code can use the same sign-in state. A request passes through Next.js Proxy (middleware in Next.js 15 or earlier), which refreshes an expiring token and writes updated cookies to the request and response. Server code creates a request-scoped Supabase client and uses getClaims() to verify the access token before returning private data. The browser client handles interactive sign-in.