21 lines
627 B
JavaScript
21 lines
627 B
JavaScript
import { createClient } from "@supabase/supabase-js";
|
|
|
|
export const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
|
|
export const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;
|
|
|
|
export const hasSupabaseConfig = Boolean(supabaseUrl && supabaseAnonKey);
|
|
|
|
export const supabase = hasSupabaseConfig
|
|
? createClient(supabaseUrl, supabaseAnonKey, {
|
|
auth: {
|
|
persistSession: true,
|
|
autoRefreshToken: true,
|
|
detectSessionInUrl: false,
|
|
lock: navigator.locks ? undefined : 'no-lock',
|
|
},
|
|
global: {
|
|
headers: { 'x-application-name': 'supersam' },
|
|
},
|
|
})
|
|
: null;
|