init
This commit is contained in:
22
mb-app/services/supabase.ts
Normal file
22
mb-app/services/supabase.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import 'react-native-url-polyfill/auto';
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import { createClient, type SupabaseClient } from '@supabase/supabase-js';
|
||||
import Constants from 'expo-constants';
|
||||
|
||||
const supabaseUrl =
|
||||
process.env.EXPO_PUBLIC_SUPABASE_URL ??
|
||||
Constants.expoConfig?.extra?.supabaseUrl ??
|
||||
'';
|
||||
const supabaseAnonKey =
|
||||
process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY ??
|
||||
Constants.expoConfig?.extra?.supabaseAnonKey ??
|
||||
'';
|
||||
|
||||
export const supabase: SupabaseClient = createClient(supabaseUrl, supabaseAnonKey, {
|
||||
auth: {
|
||||
storage: AsyncStorage,
|
||||
autoRefreshToken: true,
|
||||
persistSession: true,
|
||||
detectSessionInUrl: false,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user