What problem does it solve?
This Skill solves the complexity of managing Supabase authentication securely and efficiently within Next.js 15's App Router, ensuring proper cookie handling across different rendering contexts (Server Components, Server Actions, Client Components, Route Handlers).
Core Features & Use Cases
- Context-Specific Supabase Clients: Provides distinct factory functions for creating Supabase clients tailored to Server Components (read-only cookies), Server Actions (read-write cookies), Route Handlers, and Client Components.
- SSR Auth Implementation: Guides on implementing server-side authentication, protecting routes with middleware, and handling auth state changes.
- Debugging Common Issues: Offers solutions for "user is undefined" errors, cookie persistence problems, middleware redirect loops, and real-time subscription failures.
- Use Case: When building a Next.js application that uses Supabase for user authentication, you need to ensure that user sessions are correctly managed whether data is fetched on the server or client. This Skill provides the exact patterns to achieve this, preventing common security and functionality bugs.
Quick Start
Use the nextjs-supabase-ssr skill to create a Supabase client for server components in your Next.js application.