
Nextjs Supabase Auth
This handles the tricky parts of wiring up Supabase authentication in Next.js App Router projects, specifically the server/client boundary issues that trip people up. It's built around @supabase/ssr and focuses on middleware-based route protection, proper token handling, and OAuth callbacks. The skill pushes you toward Server Actions for auth operations and away from common mistakes like calling getSession in Server Components or manually storing tokens. Useful when you're setting up login flows, protected routes, or just need the auth boilerplate done correctly the first time instead of debugging cookie issues at midnight.
- skills.sh installs
- 410
- GitHub stars
- 33.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add davila7/claude-code-templates --skill nextjs-supabase-auth --agent claude-codeInstalls into .claude/skills of the current project.
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
Sponsors
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Frontend Development, Backend & APIs, Security, Databases
- First seen
- Jun 3, 2026
More from davila7/claude-code-templates
All 618- Clinicaltrials Database409
- Writing Plans408
- Geopandas407
- Bash Linux405
- App Store Optimization404
- Telegram Bot Builder403
- Treatment Plans403
- Micro Saas Launcher401
- Ai Product399
- Paper 2 Web399
- Best Practices398
- Json Canvas397
- Hypothesis Generation396
- Notion Research Documentation396
- Social Content396
- Sympy396
- Mcp Builder395
- Pytorch Fsdp395
- Interactive Portfolio394
- Obsidian Bases394
- Qa Test Planner394
- Railway Deployment394
- Subagent Driven Development394
- Vulnerability Scanner394