mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 20:59:40 +02:00
Migrate figgos from single Expo app to multi-app monorepo structure: - Move mobile app to apps/mobile/ - Add apps/web/ (SvelteKit) and apps/backend/ (NestJS) scaffolds - Add packages/shared/ for shared types and constants - Update root package.json with new dev commands - Temporarily skip type-check (run pnpm install first) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
import { createClient } from '@supabase/supabase-js';
|
|
import { SUPABASE_URL, SUPABASE_ANON_KEY } from './config';
|
|
|
|
// Verwende die statischen Werte aus der Konfigurationsdatei
|
|
const supabaseUrl = SUPABASE_URL;
|
|
const supabaseAnonKey = SUPABASE_ANON_KEY;
|
|
|
|
// Custom storage implementation for React Native
|
|
const ExpoAsyncStorage = {
|
|
getItem: async (key: string) => {
|
|
try {
|
|
return await AsyncStorage.getItem(key);
|
|
} catch (error) {
|
|
console.error('Error getting item from AsyncStorage:', error);
|
|
return null;
|
|
}
|
|
},
|
|
setItem: async (key: string, value: string) => {
|
|
try {
|
|
await AsyncStorage.setItem(key, value);
|
|
} catch (error) {
|
|
console.error('Error setting item in AsyncStorage:', error);
|
|
}
|
|
},
|
|
removeItem: async (key: string) => {
|
|
try {
|
|
await AsyncStorage.removeItem(key);
|
|
} catch (error) {
|
|
console.error('Error removing item from AsyncStorage:', error);
|
|
}
|
|
},
|
|
};
|
|
|
|
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
|
|
auth: {
|
|
storage: ExpoAsyncStorage,
|
|
autoRefreshToken: true,
|
|
persistSession: true,
|
|
detectSessionInUrl: false,
|
|
},
|
|
});
|