contiai / apps /web /src /lib /supabase.ts
aliroya's picture
ContiAI platform: API and queue worker in one container (part 2)
2bb5af3 verified
Raw History Blame Contribute Delete
587 Bytes
import { createClient } from "@supabase/supabase-js";
const url = import.meta.env.VITE_SUPABASE_URL ?? "";
const anonKey = import.meta.env.VITE_SUPABASE_ANON_KEY ?? "";
if (!url || !anonKey) {
// Loud on purpose: a blank auth config fails later in a way that looks like
// a login bug rather than a missing environment variable.
console.error(
"VITE_SUPABASE_URL / VITE_SUPABASE_ANON_KEY are not set - sign-in will not work",
);
}
export const supabase = createClient(url, anonKey, {
auth: { persistSession: true, autoRefreshToken: true, detectSessionInUrl: true },
});