mirror of
https://github.com/Sosokker/chefhai.git
synced 2025-12-19 14:04:08 +01:00
27 lines
829 B
TypeScript
27 lines
829 B
TypeScript
import * as SecureStore from 'expo-secure-store';
|
|
// import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
import { createClient } from '@supabase/supabase-js';
|
|
|
|
const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_PROJECT_URL as string;
|
|
const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY as string;
|
|
|
|
const ExpoSecureStoreAdapter = {
|
|
getItem: (key: string) => {
|
|
return SecureStore.getItemAsync(key);
|
|
},
|
|
setItem: (key: string, value: string) => {
|
|
SecureStore.setItemAsync(key, value);
|
|
},
|
|
removeItem: (key: string) => {
|
|
SecureStore.deleteItemAsync(key);
|
|
},
|
|
};
|
|
|
|
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
|
|
auth: {
|
|
storage: ExpoSecureStoreAdapter as any,
|
|
autoRefreshToken: true,
|
|
persistSession: true,
|
|
detectSessionInUrl: false,
|
|
},
|
|
}) |