nextjs-supabase-auth

Integrate Supabase authentication into Next.js App Router projects.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/WannaCry081/React-Workflow-Starter --skill nextjs-supabase-auth-wannacry081
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-supabase-auth
Source: https://github.com/WannaCry081/React-Workflow-Starter/tree/main/.agents/skills/nextjs-supabase-auth
Command: npx skills add https://github.com/WannaCry081/React-Workflow-Starter --skill nextjs-supabase-auth-wannacry081

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expert guidance and patterns for securely integrating Supabase authentication with Next.js App Router, covering the server/client boundary, middleware protection, and token management.

Core Features & Use Cases

  • Seamless Supabase Auth integration with Next.js App Router
  • Middleware-based route protection and session management
  • Server Actions and client/server token handling across app components

Quick Start

Set up a Next.js App Router project and implement the described auth patterns and middleware hooks.

Frequently Asked Questions about nextjs-supabase-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Supabase authentication with Next.js App Router?

To integrate Supabase authentication with Next.js App Router, use @supabase/ssr to manage secure token handling in middleware, protect routes, and perform auth operations via server actions across server and client components.

What is the best way to protect routes using Supabase middleware in Next.js?

The best way to protect routes using Supabase middleware in Next.js is to implement middleware-based route protection and session management that securely handles authentication tokens across the server and client boundary.

Does @supabase/ssr work with Next.js server components and server actions?

Yes, @supabase/ssr works with Next.js server components and server actions by providing patterns for secure token handling and executing auth operations directly within the App Router architecture.

How do I handle OAuth callbacks in Next.js App Router with Supabase?

To handle OAuth callbacks in Next.js App Router with Supabase, apply authentication patterns that process OAuth callback routes and securely manage session tokens within your server and client components.

Why does my Supabase auth session break between Next.js client and server components?

Supabase auth sessions break between Next.js client and server components when token handling is not securely managed across the boundary; using @supabase/ssr in middleware ensures consistent session management and token refresh.