Nextjs Supabase Auth
Expert guidance for Supabase Auth in Next.js App Router, covering server, client, and middleware sessions.
- CCM score
- 57 of 100
- skills.sh installs
- 411
- GitHub stars
- 34.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers session handling across Server Components, Client Components, Server Actions, and middleware for protected routes
- Includes patterns for Supabase client setup, auth middleware with session refresh, and the OAuth auth callback route
- Enforces @supabase/ssr usage and cookie-based sessions, and flags anti-patterns like getSession in Server Components and manual token storage
- Designed for projects pairing
nextjs-app-routerwithsupabase-backendthat need login and route protection
Install
$ npx -y skills add davila7/claude-code-templates --skill nextjs-supabase-auth -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Next.js + Supabase Auth
You are an expert in integrating Supabase Auth with Next.js App Router. You understand the server/client boundary, how to handle auth in middleware, Server Components, Client Components, and Server Actions.
Your core principles:
- Use @supabase/ssr for App Router integration
- Handle tokens in middleware for protected routes
- Never expose auth tokens to client unnecessarily
- Use Server Actions for auth operations when possible
- Understand the cookie-based session flow
Capabilities
- nextjs-auth
- supabase-auth-nextjs
- auth-middleware
- auth-callback
Requirements
- nextjs-app-router
- supabase-backend
Patterns
Supabase Client Setup
Create properly configured Supabase clients for different contexts
Auth Middleware
Protect routes and refresh sessions in middleware
Auth Callback Route
Handle OAuth callback and exchange code for session
Anti-Patterns
❌ getSession in Server Components
❌ Auth State in Client Without Listener
❌ Storing Tokens Manually
Related Skills
Works well with: nextjs-app-router, supabase-backend
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Backend & APIs, Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What does the nextjs-supabase-auth skill do?
The nextjs-supabase-auth skill guides an agent through integrating Supabase Auth with the Next.js App Router. It covers Supabase client setup with @supabase/ssr, auth middleware that protects routes and refreshes sessions, and an auth callback route that exchanges the OAuth code for a session.
How do I install the nextjs-supabase-auth skill?
Run npx -y skills add davila7/claude-code-templates --skill nextjs-supabase-auth -y in your project. Once installed, nextjs-supabase-auth lets the agent write Supabase login, middleware and protected route code for a Next.js App Router app.
Where does nextjs-supabase-auth sit in the Backend and APIs category?
nextjs-supabase-auth is listed in the Backend and APIs category on Claude Marketplaces, next to entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. It stands apart by focusing on cookie-based session flow between Next.js server and client code.
Who should use nextjs-supabase-auth?
nextjs-supabase-auth suits developers building login, logout and protected routes in a Next.js App Router project that uses Supabase. It also helps when the agent must handle auth tokens in middleware rather than exposing them to the client.
Does nextjs-supabase-auth need Next.js or Supabase to already be set up?
Yes, nextjs-supabase-auth requires the nextjs-app-router and supabase-backend skills. Use them alongside it, since the skill points to both as the pieces it works well with.
More from davila7/claude-code-templates
All 398- Clinicaltrials Database409
- Error Resolver409
- Geopandas408
- Bash Linux406
- Email Composer406
- Treatment Plans406
- App Store Optimization405
- Micro Saas Launcher401
- Interactive Portfolio400
- Paper 2 Web400
- Ai Product399
- Sympy397
- Vulnerability Scanner397
- Hypothesis Generation396
- Pytorch Fsdp395
- Using Superpowers395
- Railway Deployment394
- Documentation Templates393
- Spreadsheet393
- Venue Templates393
- Rag Engineer392
- Stripe Integration392
- Firebase390
- Isms Audit Expert390
Similar to Nextjs Supabase Auth
More Backend & APIsnextauth-authenticationmindrally/skills1.2K installsSetup guide for NextAuth.js v5 in Next.js covering providers, JWT and database sessions, and route protection.
auth-patternsdavepoon/buildwithclaude183 installsReference guide for authentication in Next.js covering NextAuth.js (Auth.js) setup, middleware-based route protection, and session handling.
clerk-authdavila7/claude-code-templates220 installsClerk authentication patterns for Next.js App Router, middleware route protection, and server-side user access.
nextjs-authenticationgiuseppe-trisciuoglio/developer-kit4K installsComplete Auth.js 5 setup for Next.js App Router, covering OAuth, route protection, and role-based access.
clerk-authenticationmindrally/skills724 installsGuidance for Clerk authentication in Next.js covering middleware, hooks, server actions, and route protection.
nuxt-better-authonmax/nuxt-skills2.2K installsAuthentication guide for Nuxt apps using the Better Auth module, with a reference file for each task.