Use createClient() for authenticated pages (RLS enforced), createAdminClient() for server-side writes (service_role), and createReadOnlyClient() for public pages (anon key).
Why This Matters
Using the wrong client type either exposes data (admin client in page) or blocks legitimate access (authenticated client for public content). Each has different security characteristics.
Tags
nextjssupabaseAuthentication
Related Rules
Catch this automatically on every PR
BeforeMerge scans your pull requests against this rule and 3+ others. Get actionable feedback before code ships.