supabase-patterns

Integrate Supabase components including authentication, RLS, storage, Edge Functions, and realtime subscriptions.

1|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/Inteligentsensingsolutions/tdd-dev-workflow --skill supabase-patterns-inteligentsensingsolutions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-patterns
Source: https://github.com/Inteligentsensingsolutions/tdd-dev-workflow/tree/main/skills/supabase-patterns
Command: npx skills add https://github.com/Inteligentsensingsolutions/tdd-dev-workflow --skill supabase-patterns-inteligentsensingsolutions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Consolidates best-practice guidance for integrating Supabase into full-stack applications so teams avoid insecure defaults, brittle migrations, and incorrect RLS or storage policies.

Core Features & Use Cases

  • Client initialization: Environment-aware patterns for browser, SSR/middleware, and server/admin clients to prevent accidental exposure of service keys.
  • Authentication & RLS: Session handling, JWT claim usage, and concrete Row-Level Security policy examples to enforce per-user and role-based access.
  • Storage, Edge Functions & Realtime: Safe bucket policies and signed URLs, Edge Function layout and deploy workflow, realtime channel subscriptions and presence patterns.
  • Migrations & Operations: Migration file structure, rules for safe production changes, and developer workflows for generating/applying schema diffs.
  • Use case: Set up a Next.js app with secure auth, per-user RLS on profiles and posts, storage for user avatars, a webhook-processing Edge Function, and realtime updates for live feeds.

Quick Start

Ask for a step-by-step checklist to configure Supabase for a Next.js project including client setup, RLS policies for profiles and posts, a storage bucket with upload policy, a sample Edge Function, and migration guidance.

Frequently Asked Questions about supabase-patterns

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

FAQPage Schema
How do I set up Supabase clients for SSR and server environments without exposing service keys?

Environment-aware Supabase client initialization separates browser, SSR, and server contexts to prevent accidental service key exposure. Apply distinct client setups for browser, middleware, and admin operations to maintain secure key boundaries across full-stack applications.

How do I write Supabase RLS policies for per-user and role-based access control?

Supabase RLS policies enforce per-user and role-based access by utilizing JWT claims within your database rules. Concrete policy examples map authenticated session data directly to row-level permissions, securing tables like profiles and posts from unauthorized reads or writes.

What is the best way to manage Supabase migrations and apply safe schema changes in production?

Supabase migrations manage safe production schema changes through structured migration files and developer workflows for generating diffs. Following specific rules for schema modifications ensures reliable tracking and application of database changes without brittle deployments.

How do I handle Supabase storage bucket policies and generate signed URLs for user uploads?

Supabase storage policies enforce safe bucket access while signed URLs securely handle user uploads like avatars. Configuring explicit upload policies restricts unauthorized file access and ensures media is only accessible by designated users.

Can I use Supabase Edge Functions to process webhooks in a Next.js application?

Supabase Edge Functions process webhooks in Next.js applications using a specific layout and deploy workflow. This integration pattern handles webhook payloads efficiently at the edge, bypassing the need for dedicated server infrastructure.

How do realtime subscriptions and presence work with Supabase channels for live feeds?

Supabase realtime subscriptions manage live data feeds through channel-based listening and presence patterns. Subscribing to database changes via channels provides instant UI updates and tracks active user presence across connected clients.