File size: 423 Bytes
5307e67
bd28470
 
5307e67
bd28470
5307e67
bd28470
 
5307e67
bd28470
 
 
 
 
5307e67
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { createClient, type SupabaseClient } from "@supabase/supabase-js";
import { getEnv } from "../config/env";

let _client: SupabaseClient<any> | null = null;

export function getSupabaseClient(): SupabaseClient<any> {
  if (!_client) {
    const env = getEnv();
    _client = createClient<any>(env.SUPABASE_URL, env.SUPABASE_SERVICE_ROLE_KEY, {
      auth: { persistSession: false },
    });
  }
  return _client;
}