From 1e8894179673f0dfc19bc8cd5193cfce8fccdd20 Mon Sep 17 00:00:00 2001 From: byGalax Date: Wed, 13 May 2026 23:55:35 +0200 Subject: [PATCH] feat(mobile): supabase client wired through async-storage session --- apps/mobile/lib/supabase.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 apps/mobile/lib/supabase.ts 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, +});