Spaces:
Sleeping
Sleeping
| import { createClient } from "@supabase/supabase-js"; | |
| import { getEnv } from "../config/env"; | |
| let _client: ReturnType<typeof createClient> | null = null; | |
| export function getSupabaseClient() { | |
| if (!_client) { | |
| const env = getEnv(); | |
| _client = createClient(env.SUPABASE_URL, env.SUPABASE_SERVICE_ROLE_KEY, { | |
| auth: { persistSession: false }, | |
| db: { schema: "public" }, | |
| }); | |
| } | |
| return _client; | |
| } | |