Skip to content

supabase

Use when working with Supabase — database queries, authentication, storage, real-time subscriptions, Edge Functions, or Row Level Security. Also use when setting up Supabase in a new project or migrating from Firebase.

ModelSource
sonnetpack: database
Full Reference

┏━ 🔧 supabase ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when working with Supabase — database quer… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Open-source Firebase alternative built on Postgres — database, auth, storage, realtime, and Edge Functions (Deno runtime) in one platform. SDK: @supabase/supabase-js v2.x + @supabase/ssr for server-side rendering.

ItemValue
Dashboardhttps://supabase.com/dashboard
New projecthttps://database.new
Installnpm install @supabase/supabase-js @supabase/ssr
Env var (URL)NEXT_PUBLIC_SUPABASE_URL
Env var (key)NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY (or legacy anon key)
Type gennpx supabase gen types typescript --project-id <ref> > database.types.ts
Fastest startnpx create-next-app -e with-supabase
FileCovers
reference/setup.mdInstall, env vars, Next.js App Router clients, middleware, React/Vite, standalone Node
reference/database.mdSelect, insert, update, upsert, delete, RPC, count, transactions, filter operators, error codes
reference/auth.mdEmail+password, OAuth, magic link/OTP, getUser vs getSession, page protection, anonymous sign-in
reference/rls.mdEnable RLS, policy anatomy, own-data patterns, multi-tenant org patterns, JWT claims, helper functions, performance, testing
reference/storage.mdBuckets, upload, public/signed URLs, download, list/delete, image transforms, storage RLS policies
reference/realtime.mdPostgres changes, broadcast, presence, channel cleanup
reference/edge-functions.mdCreate, local dev, secrets, deploy, invoke from client, built-in env vars
reference/typescript.mdType generation CLI, using generated types, type helpers, CI auto-generation
reference/branching.mdPreview branches, lifecycle, enable, workflow, costs, migrations CLI, local dev stack
reference/pricing.mdPlans, free tier limits, Pro overage rates, PostgREST v14

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.