supabase

Configure Supabase clients, auth modes, and RLS policies across runtimes.

1|Updated Mar 18, 2024
One-click install
npx skills add https://github.com/erfianugrah/dotfiles --skill supabase-erfianugrah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase
Source: https://github.com/erfianugrah/dotfiles/tree/main/.pi/agent/skills/supabase
Command: npx skills add https://github.com/erfianugrah/dotfiles --skill supabase-erfianugrah

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you implement and debug Supabase functionality correctly and securely across auth, RLS, migrations, and SDK/runtime integrations so you don’t ship broken or unsafe code.

Core Features & Use Cases

  • Supabase library selection: Choose the right client for the security model (browser vs Next.js SSR vs backend) and avoid unsafe mismatches between cookie auth and JWT flows.
  • @supabase/server auth modes: Use withSupabase with clear auth modes (user, none, secret, publishable, and named variants) and correct header/credential handling.
  • Operational safety for changes: Apply RLS-by-default guidance, verify fixes with test queries, and use safe iteration practices for schema changes.
  • Runtime integration guardrails: Handle Edge Functions, Workers, connection pooling ports, pgvector/Realtime/Storage/Queues patterns, and common production gotchas (e.g., Edge JWT checks, CSP/WebSocket issues).

Quick Start

Use the supabase skill to implement an authenticated Edge Function with @supabase/server using auth: user, then fix any RLS or session handling issues you encounter.

Frequently Asked Questions about supabase

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

FAQPage Schema
How do I choose the right Supabase client SDK for Next.js SSR versus browser environments?

Choosing the right Supabase client SDK depends on your runtime: use @supabase/ssr for Next.js SSR cookie auth, @supabase/server for backend, and @supabase/supabase-js for browser to avoid unsafe mismatches between cookie and JWT flows.

How do I implement Row Level Security policies in Postgres using Supabase?

Implementing Row Level Security policies in Supabase requires applying RLS-by-default guidance to your Postgres tables, verifying fixes with test queries, and using safe iteration practices for schema changes to ensure secure data access.

What's the best way to configure auth modes in Supabase Edge Functions?

Configuring auth modes in Supabase Edge Functions involves using withSupabase with clear auth variants like user, none, secret, or publishable, ensuring correct header and credential handling, and validating Edge JWT checks for production safety.

Does Supabase work with serverless runtimes like Cloudflare Workers and Edge Functions?

Supabase works with serverless runtimes like Cloudflare Workers and Edge Functions by providing runtime integration guardrails for connection pooling ports, Realtime/WebSocket issues, and Storage patterns to manage common production gotchas.

How do I handle JWT and session debugging for Supabase authentication?

Handling JWT and session debugging for Supabase authentication involves selecting the proper SDK, configuring environment variables and auth modes correctly, and verifying against current docs and upstream source to resolve cookie auth and JWT flow mismatches.

Can I use Postgres extensions like pgvector and pg_cron with Supabase migrations?

You can use Postgres extensions like pgvector, pg_cron, pg_graphql, and pgmq with Supabase migrations by following operational safety patterns that verify fixes with test queries and perform recovery and verification after every schema change.