supabase-sdk-patterns
Installation
SKILL.md
Supabase SDK Patterns
Overview
Production patterns for @supabase/supabase-js v2 and supabase-py, where every call returns { data, error } and success is never assumed. Covers client initialization, CRUD with filters, auth, realtime, storage, and RPC, with Python equivalents for the query patterns.
Prerequisites
- Supabase project with URL and anon key (or service role key for server-side)
@supabase/supabase-jsv2 installed (TypeScript) orsupabasepip package (Python)- TypeScript projects: generated database types via
supabase gen types typescript
Instructions
Step 1: Initialize a typed singleton client
Create one client instance and reuse it. Never call createClient per-request — a
singleton preserves the auth session and connection pool.