summaryrefslogtreecommitdiff
path: root/apps/mobile/lib/supabase.ts
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-18 02:58:27 +0000
committersoryu <soryu@soryu.co>2026-01-18 02:58:27 +0000
commitfcf9e70d54bd737d2dea848d25314120f37db503 (patch)
treebc304a9e153485f7686830614b2ddae4d4ff182e /apps/mobile/lib/supabase.ts
parentf84a7f2d820f6f432be2b1d78d6bf833b5b19380 (diff)
downloadsoryu-fcf9e70d54bd737d2dea848d25314120f37db503.tar.gz
soryu-fcf9e70d54bd737d2dea848d25314120f37db503.zip
[WIP] Heartbeat checkpoint - 2026-01-18 02:58:27 UTC
Diffstat (limited to 'apps/mobile/lib/supabase.ts')
-rw-r--r--apps/mobile/lib/supabase.ts29
1 files changed, 29 insertions, 0 deletions
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,
+ },
+});