From fcf9e70d54bd737d2dea848d25314120f37db503 Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 18 Jan 2026 02:58:27 +0000 Subject: [WIP] Heartbeat checkpoint - 2026-01-18 02:58:27 UTC --- apps/mobile/lib/supabase.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 apps/mobile/lib/supabase.ts (limited to '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..2329494 --- /dev/null +++ b/apps/mobile/lib/supabase.ts @@ -0,0 +1,29 @@ +import { createClient } from '@supabase/supabase-js'; +import * as SecureStore from 'expo-secure-store'; + +// Supabase configuration +// In production, these would come from environment variables +const SUPABASE_URL = 'https://your-project.supabase.co'; +const SUPABASE_ANON_KEY = 'your-anon-key'; + +// Custom storage using expo-secure-store for React Native +const ExpoSecureStoreAdapter = { + getItem: (key: string) => { + return SecureStore.getItemAsync(key); + }, + setItem: (key: string, value: string) => { + return SecureStore.setItemAsync(key, value); + }, + removeItem: (key: string) => { + return SecureStore.deleteItemAsync(key); + }, +}; + +export const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, { + auth: { + storage: ExpoSecureStoreAdapter, + autoRefreshToken: true, + persistSession: true, + detectSessionInUrl: false, + }, +}); -- cgit v1.2.3