mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 07:41:09 +02:00
Projects included: - maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing) - manacore (Expo mobile + SvelteKit web + Astro landing) - manadeck (NestJS backend + Expo mobile + SvelteKit web) - memoro (Expo mobile + SvelteKit web + Astro landing) This commit preserves the current state before monorepo restructuring. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
1,016 B
TypeScript
36 lines
1,016 B
TypeScript
import { createClient } from '@supabase/supabase-js';
|
|
import { Platform } from 'react-native';
|
|
import memoryStorage from './memoryStorage';
|
|
|
|
const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL;
|
|
const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY;
|
|
|
|
// Überprüfen, ob die Umgebungsvariablen definiert sind
|
|
if (!supabaseUrl || !supabaseAnonKey) {
|
|
console.error('Supabase URL oder Anon Key fehlen in den Umgebungsvariablen');
|
|
}
|
|
|
|
// Web-spezifische Konfiguration
|
|
const webConfig = Platform.OS === 'web' ? {
|
|
global: {
|
|
headers: {
|
|
'X-Client-Info': 'supabase-js-web',
|
|
},
|
|
},
|
|
// Disable realtime for web to avoid import issues
|
|
realtime: {
|
|
params: {
|
|
eventsPerSecond: 0,
|
|
},
|
|
},
|
|
} : {};
|
|
|
|
export const supabase = createClient(supabaseUrl || '', supabaseAnonKey || '', {
|
|
auth: {
|
|
storage: memoryStorage, // Verwende benutzerdefinierte memoryStorage-Lösung
|
|
autoRefreshToken: true,
|
|
persistSession: true,
|
|
detectSessionInUrl: false,
|
|
},
|
|
...webConfig,
|
|
});
|