File size: 586 Bytes
5463318
 
9a10d7c
 
 
5463318
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import { createClient } from '@supabase/supabase-js';

const runtimeConfig = (typeof window !== 'undefined' && window.__APP_CONFIG__) || {};
const supabaseUrl = runtimeConfig.VITE_SUPABASE_URL || import.meta.env.VITE_SUPABASE_URL || '';
const supabaseAnonKey = runtimeConfig.VITE_SUPABASE_ANON_KEY || import.meta.env.VITE_SUPABASE_ANON_KEY || '';

if (!supabaseUrl || !supabaseAnonKey) {
    console.warn("Supabase URL or Anon Key is missing. Please set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY in your .env");
}

export const supabase = createClient(supabaseUrl, supabaseAnonKey);