diff --git a/apps/mobile/lib/supabase.ts b/apps/mobile/lib/supabase.ts new file mode 100644 index 0000000..4520fcf --- /dev/null +++ b/apps/mobile/lib/supabase.ts @@ -0,0 +1,16 @@ +import { createClient } from '@chat-app/shared/supabase'; + +import { env } from './env'; +import { sessionStorage } from './sessionStorage'; + +// Single Supabase client instance for the mobile app. Token storage goes +// to AsyncStorage so the session survives reboots. detectSessionInUrl is +// false because the magic-link callback is handled by our own +// app/auth/callback.tsx screen — Expo Router routes the deep link to +// that file, and we parse it explicitly. +export const supabase = createClient({ + url: env.supabaseUrl, + anonKey: env.supabaseAnonKey, + sessionStorage, + detectSessionInUrl: false, +});