supabase-auth-data

Configure Supabase clients for server, browser, and admin contexts.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/harryy2510/dotclaude --skill supabase-auth-data
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-auth-data
Source: https://github.com/harryy2510/dotclaude/tree/main/plugins/dotclaude/skills/supabase-auth-data
Command: npx skills add https://github.com/harryy2510/dotclaude --skill supabase-auth-data

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing Supabase clients across server, browser, and admin contexts can be error-prone and hard to audit, especially when handling auth flows, type generation, migrations, and environment configuration.

Core Features & Use Cases

  • Server: getSupabaseServerClient() for server-side data fetching with SSR cookie handling.
  • Browser: getSupabaseBrowserClient() for client-side auth state and a singleton pattern.
  • Admin: getSupabaseAdminClient() for admin tasks and cross-user reads.
  • Auth flow management with onAuthStateChange, route guards, and session priming.
  • Types & migrations guidance: auto-generated types, immutable migrations, and environment secrets handling.
  • Environment variable management with Cloudflare bindings and client exposure.

Quick Start

Install and initialize the appropriate Supabase clients in your app by using getSupabaseServerClient in server routes, getSupabaseBrowserClient in the UI, and getSupabaseAdminClient for admin tasks.

Frequently Asked Questions about supabase-auth-data

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

FAQPage Schema
How do I manage Supabase clients for server, browser, and admin contexts in Next.js?

Managing Supabase clients across contexts requires distinct setups: a server client for SSR cookie handling, a browser client for singleton auth state, and an admin client for cross-user operations. This Skill provides functions to wire all three consistently.

What is the best way to handle Supabase auth state changes and route guards?

Handling Supabase auth state changes and route guards involves managing onAuthStateChange events and session priming. This Skill provides structured workflows to secure routes and maintain consistent client-side authentication state.

Does this Supabase auth workflow support TanStack Start and Cloudflare bindings?

Yes, this Supabase auth workflow supports TanStack Start and Next.js frameworks. It also handles environment variable management specifically with Cloudflare bindings and controls client exposure to secrets.

How do I generate types and handle immutable migrations for a Supabase database?

Generating types and handling immutable migrations for a Supabase database requires auto-generated types and strict immutability rules. This Skill guides you through setting up type generation and enforcing immutable migration workflows.

Why do I need a separate Supabase admin client instead of using the server client?

A separate Supabase admin client is necessary for administrative tasks and cross-user reads that bypass standard Row Level Security. Using the server client for these operations would fail due to missing elevated privileges.

How do I handle SSR cookies when fetching data with a Supabase server client?

Handling SSR cookies with a Supabase server client involves passing server-side cookies to the client instance during data fetching. This Skill provides a getSupabaseServerClient function that automatically manages this cookie passing.