import { createClient } from "@supabase/supabase-js"; // Check for runtime config (injected by backend) or build-time config (local dev) const getEnv = (key) => { if (typeof window !== "undefined" && window.__ENV__ && window.__ENV__[key]) { return window.__ENV__[key]; } return import.meta.env[key]; }; const supabaseUrl = (getEnv("VITE_SUPABASE_URL") || "").trim(); const supabaseKey = (getEnv("VITE_SUPABASE_ANON_KEY") || "").trim(); if (!supabaseUrl || !supabaseKey) { console.warn("Supabase credentials missing! App may fail."); } export const supabase = createClient(supabaseUrl, supabaseKey);