Add DevConnect Supabase client (non-throwing, optional)
cgen-19e6ea8dadae4adfba7541d9fb16e271
This commit is contained in:
parent
cbda3389fd
commit
fb496e9ece
1 changed files with 12 additions and 0 deletions
12
client/lib/supabase-devconnect.ts
Normal file
12
client/lib/supabase-devconnect.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { createClient, type SupabaseClient } from "@supabase/supabase-js";
|
||||||
|
|
||||||
|
const devUrl = import.meta.env.VITE_DEVCONNECT_URL as string | undefined;
|
||||||
|
const devAnon = import.meta.env.VITE_DEVCONNECT_ANON_KEY as string | undefined;
|
||||||
|
|
||||||
|
export const hasDevConnect = Boolean(devUrl && devAnon);
|
||||||
|
|
||||||
|
export const devconnect: SupabaseClient | null = hasDevConnect
|
||||||
|
? createClient(devUrl!, devAnon!, {
|
||||||
|
auth: { autoRefreshToken: false, persistSession: false, detectSessionInUrl: false },
|
||||||
|
})
|
||||||
|
: null;
|
||||||
Loading…
Reference in a new issue