import { createClient } from '@supabase/supabase-js'; // The app talks to Supabase through same-origin paths (/auth, /rest, /realtime, // /storage). In dev the Vite server proxies them to the local Supabase stack; // in Docker the app's nginx does the same. This avoids CORS entirely. const url = import.meta.env.VITE_SUPABASE_URL || window.location.origin; const anonKey = import.meta.env.VITE_SUPABASE_ANON_KEY; if (!anonKey) { console.warn('[convivo-admin] VITE_SUPABASE_ANON_KEY is not set.'); } export const supabase = createClient(url, anonKey, { auth: { persistSession: true, autoRefreshToken: true, detectSessionInUrl: false, }, realtime: { params: { eventsPerSecond: 10 }, }, });