Updated

How do I add authentication to a Next.js app?

Use Supabase Auth with the @supabase/ssr package to add authentication to a Next.js app. It handles sign-up, sign-in, sessions, and social login, and it works with the Next.js App Router’s server components and route handlers.

To skip building the web sign-in UI yourself, install the pre-built Authentication components from the Supabase Library. They cover password sign-in, social sign-in, and OAuth consent.

To see a full flow end to end - a demo app where users can sign up or sign in and then update their account with public profile information - follow Build a User Management App with Next.js or use the Supabase Starter from the Vercel template library.