Intermediatenextjssupabaseauthoauth
Next.js 16 + Supabase + GitHub OAuth
Wire up a Next.js 16 app with Supabase Postgres and GitHub OAuth via the new proxy.ts convention.
- Step 1
Scaffold the Next.js app
Create a new Next.js 16 project with TypeScript, Tailwind, and the App Router.
npx create-next-app@latest my-app --typescript --tailwind --app --no-src-dir - Step 2
Install Supabase SSR helpers
These provide cookie-aware clients that work in Server Components, Route Handlers, and proxy.ts.
npm install @supabase/supabase-js @supabase/ssr - Step 3
Create proxy.ts (formerly middleware.ts)
Next.js 16 renamed the middleware file convention to proxy. The function name and type change too — middleware() becomes proxy(), NextMiddleware becomes NextProxy.
⚠ Heads up: If you copy a Next.js 14/15 tutorial verbatim, your auth will silently fail. The old middleware.ts filename no longer executes. - Step 4
Configure GitHub OAuth in Supabase
In the Supabase dashboard → Authentication → Providers → GitHub, enable the provider and paste your GitHub OAuth app's Client ID and Secret. The callback URL is auto-generated.
Feature requests
Sign in to suggest features or vote on existing ones.
No feature requests yet.
Discussion
0 people marked this as worked·Sign in to mark your own.
Sign in to join the discussion.
No comments yet.