nextjs-supabase-auth

Integrate Supabase authentication with Next.js App Router protected routes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integrates Supabase Auth with Next.js App Router to streamline secure authentication, token management, and protected routes across server and client boundaries.

Core Features & Use Cases

  • Server-side middleware integration for protected routes and session handling
  • Supabase authentication flows (OAuth, passwordless) within Next.js App Router
  • Server Components, Client Components, and Server Actions-aware auth patterns for secure apps

Quick Start

Configure the Supabase client in your Next.js project, wire middleware for protected routes, and test login and session flows.

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 Auth with Next.js App Router?

Integrate Supabase Auth with Next.js App Router by configuring the Supabase client, wiring middleware for protected routes, and implementing server actions to manage cookies and user sessions securely across server and client boundaries.

How does middleware handle protected routes in Next.js with Supabase?

Middleware protects routes in Next.js by intercepting requests, validating Supabase user sessions, and redirecting unauthenticated users. This server-side approach manages cookies securely without exposing tokens.

Can I use server actions for Supabase authentication without exposing tokens?

Yes, you can use server actions for Supabase authentication without exposing tokens. Server actions execute on the server, allowing secure cookie management and session validation across server and client component boundaries.

Does Next.js App Router support OAuth and passwordless login flows with Supabase?

Yes, Next.js App Router supports OAuth and passwordless login flows with Supabase. You can implement these authentication flows within App Router components while maintaining secure session management across boundaries.

What is the best way to manage user sessions across server and client components in Next.js?

The best way to manage user sessions across server and client components is using @supabase/ssr. This approach handles cookie management and session validation securely, ensuring tokens are never exposed to the client.