Skip to main content
skill

nextjs-supabase-auth · davila7 — Claude Code skill for Supabase Auth

Guides the agent through Supabase Auth in Next.js App Router: middleware, OAuth callback, protected routes and cookie-based sessions.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --skill development/nextjs-supabase-auth
Open on GitHub

What nextjs-supabase-auth does

This skill sets the boundaries for auth work in App Router projects. The agent keeps track of the server/client split: where a session gets read, where it gets refreshed, what must stay out of the browser. Middleware, Server Components, Client Components and Server Actions each get their own treatment.

Three patterns are covered. Configuring Supabase clients for different contexts. Middleware that guards routes and refreshes the session. A callback route that trades an OAuth code for a session. The skill also lists anti-patterns, among them calling getSession inside Server Components and keeping tokens by hand.

It builds on @supabase/ssr and cookie sessions, so a project still on @supabase/auth-helpers will need its dependencies reworked first. Pairs with the nextjs-app-router and supabase-backend skills.

What it helps with

  • guard routes in middleware without dropping the session
  • exchange an OAuth code for a session in the callback route
  • separate Supabase clients for server and browser
  • drop getSession calls from Server Components
  • stop storing tokens manually

Example prompts for the agent

  • Wire up Supabase login in App Router with @supabase/ssr
  • Add middleware that refreshes the session and blocks private routes
  • Create a callback route that turns an OAuth code into a session

How to install nextjs-supabase-auth

1claude-code-templates

npx claude-code-templates@latest --skill development/nextjs-supabase-auth

2Skills CLI (Vercel)

npx skills add davila7/claude-code-templates --skill nextjs-supabase-auth -a claude-code

3Manually: put the files in place

~/.claude/skills/nextjs-supabase-auth/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/nextjs-supabase-auth/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about nextjs-supabase-auth

How do I install nextjs-supabase-auth in Claude Code?

With the templates CLI: npx claude-code-templates@latest --skill development/nextjs-supabase-auth. Or through the skills CLI: npx skills add davila7/claude-code-templates --skill nextjs-supabase-auth -a claude-code.

What does nextjs-supabase-auth do?

It steers the agent through Supabase Auth in Next.js App Router: client setup, middleware, the OAuth callback and protected routes.

What do I need before using it?

A Next.js App Router project and a Supabase backend. The integration relies on @supabase/ssr and cookie sessions.

Similar skills

All skills for Backend and APIs →

nextjs-supabase-auth by other authors comes first.

From the same set238

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor