import "server-only"; import { createClient as createSupabaseClient } from "@supabase/supabase-js"; import type { Database } from "@/lib/database.types"; // Uses the service role key — bypasses RLS entirely. Only import this from // trusted server-only code (e.g. the signup trigger fallback, admin tooling). // Never expose this client or its key to the browser. export function createAdminClient() { return createSupabaseClient( process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.SUPABASE_SERVICE_ROLE_KEY!, { auth: { autoRefreshToken: false, persistSession: false, }, } ); }