What problem does it solve?
Managing Supabase clients across server, browser, and admin contexts can be error-prone and hard to audit, especially when handling auth flows, type generation, migrations, and environment configuration.
Core Features & Use Cases
- Server: getSupabaseServerClient() for server-side data fetching with SSR cookie handling.
- Browser: getSupabaseBrowserClient() for client-side auth state and a singleton pattern.
- Admin: getSupabaseAdminClient() for admin tasks and cross-user reads.
- Auth flow management with onAuthStateChange, route guards, and session priming.
- Types & migrations guidance: auto-generated types, immutable migrations, and environment secrets handling.
- Environment variable management with Cloudflare bindings and client exposure.
Quick Start
Install and initialize the appropriate Supabase clients in your app by using getSupabaseServerClient in server routes, getSupabaseBrowserClient in the UI, and getSupabaseAdminClient for admin tasks.