supabase-client

Initialize Supabase clients for server, client, and admin contexts in Next.js.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/PolarDyth/travel-money-mk2 --skill supabase-client
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: supabase-client
Source: https://github.com/PolarDyth/travel-money-mk2/tree/main/.skillshare/skills/travel-money-mk2-supabase-client
Command: npx skills add https://github.com/PolarDyth/travel-money-mk2 --skill supabase-client

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides clear patterns for initializing and using Supabase clients across different parts of a Next.js application, ensuring correct authentication and authorization handling.

Core Features & Use Cases

  • Server-Side Client: For use in Server Components, Server Actions, and Route Handlers, leveraging cookie-based authentication.
  • Client-Side Client: For use in Client Components and hooks, utilizing browser-based authentication and real-time subscriptions.
  • Admin Client: For server-side operations that require bypassing Row Level Security (RLS).
  • Auth State Management: A use-user hook for seamless authentication state tracking in client components.

Quick Start

Use the supabase-client skill to initialize a server-side Supabase client within a Next.js Server Component.

Frequently Asked Questions about supabase-client

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

FAQPage Schema
How do I initialize a Supabase client in Next.js Server Components?▼

To initialize a Supabase client in Next.js Server Components, use a server-side pattern that leverages cookie-based authentication for secure data fetching and mutations within Server Components, Server Actions, and Route Handlers.

What is the best way to manage Supabase authentication state in Next.js Client Components?▼

Managing Supabase authentication state in Client Components is best handled through a custom hook that tracks browser-based authentication, enabling seamless session updates and real-time subscriptions.

Can I bypass Row Level Security policies for server-side operations in Supabase?▼

Yes, you can bypass Row Level Security policies for server-side operations by initializing an admin Supabase client, which is specifically designed for privileged server contexts that require unrestricted data access.

Does this Supabase client pattern support real-time subscriptions in Next.js?▼

Yes, the client-side Supabase client pattern supports real-time subscriptions by utilizing browser-based authentication, allowing Next.js Client Components to actively listen to database changes.

How do I update user sessions with Supabase middleware in a Next.js application?▼

Updating user sessions with Supabase middleware involves integrating middleware to refresh and manage session cookies, ensuring authentication state remains synchronized across server-side and client-side Next.js contexts.