supabase
Made by JeffConfigure Supabase for Next.js SaaS: Drizzle + pooler, Google-only Auth, RLS, cost optimization. Use when setting up Supabase, connecting Drizzle, SSR auth, or optimizing costs.
From Jeffrey's Skills.md: professionally crafted skills for any AI agent, installed and kept in sync by the jsm CLI. Subscription only, $20/month.
Works With
Quality and Utility come from canonical skill metadata. Community ratings appear separately as stars when subscriber reviews exist.
Subscribe to download
Public previews are available, but downloads, CLI sync, and premium content require an active subscription.
Sign In to Subscribe- Full skill content with deterministic versioning
- CLI sync + local search index
- Access to Jeffrey’s premium library
Save to your account
Saved skills live in your cloud list. Run jsm sync on each machine to pull them locally.
What's New with this Skill
1Updates, enhancements, and release notes for this skill.
New: Supabase for Next.js SaaS, two lanes with RLS where it matters and Drizzle where it doesn't
Two lanes for data access: user-scoped via @supabase/ssr + RLS (the database enforces access), server-scoped via Drizzle through the pooler (privileged). Use getClaims(), not getSession(). The transaction pooler (port 6543) requires prepare: false. IPv4-only environments (Vercel, GitHub Actions) cannot use direct connections; pooler only. Google OAuth only: email/password, magic links and phone are disabled.
- Two-lane data access: user-scoped via @supabase/ssr + RLS, server-scoped via Drizzle through the Supavisor pooler for migrations, admin tasks and billing webhooks
- getClaims() not getSession(). The first validates the JWT signature locally on every call; the second can be fooled by spoofed cookies. Using it in middleware also fixes random logouts from tokens that never refresh
- Transaction pooler (port 6543) for runtime requires prepare: false. Without it, prepared statements break across pooled connections (prepared statement does not exist). Session pooler (port 5432) is for migrations
- Direct connection is IPv6-only. Vercel and GitHub Actions are IPv4-only; they MUST use the pooler. Symptom of getting this wrong: ENETUNREACH / network unreachable
- Username format is postgres.<project_ref>: the dot is real, copy exactly from Dashboard → Connect. Wrong format symptom: Tenant or user not found
- Google OAuth only. Email/password, magic links, and phone are explicitly disabled, and the skill walks through the Google Cloud Console redirect URI and the OAuth callback route
- app_metadata for tenant_id claims, never user_metadata, because user_metadata is user-modifiable
- Cost optimization: Spend Cap on Pro tier, sensitive tables in a private schema, cron rollups for event-heavy tables, Smart CDN + high cache-control on Storage
- Separate prod and staging Supabase projects for blast-radius isolation; migrations come from drizzle-kit generate into supabase/migrations and are applied with drizzle-kit migrate
The two-lane architecture is the core decision. Lane A (@supabase/ssr → PostgREST Data API) is for anything user-scoped: browser and Server Components, JWT validated via getClaims(), and multi-tenant reads/writes obey RLS naturally. Lane B (Drizzle → postgres.js → Supavisor pooler) is for server-only paths: migrations, admin tasks, billing webhooks. That lane is privileged and does not go through RLS.