mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 20:39:41 +02:00
- Restructure chat as apps/mobile, apps/web, apps/landing, backend - Add NestJS backend for secure Azure OpenAI API calls - Remove exposed API key from mobile app (security fix) - Add shared chat-types package - Create SvelteKit web app scaffold - Create Astro landing page scaffold - Update pnpm workspace configuration - Add project-level CLAUDE.md documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { createClient } from '@supabase/supabase-js';
|
|
|
|
const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL || '';
|
|
const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY || '';
|
|
|
|
// Überprüfe, ob wir in einer Browser-Umgebung sind
|
|
const isBrowser = typeof window !== 'undefined';
|
|
|
|
// Importiere AsyncStorage nur, wenn wir in einer Browser-Umgebung sind
|
|
let AsyncStorage;
|
|
if (isBrowser) {
|
|
AsyncStorage = require('@react-native-async-storage/async-storage').default;
|
|
}
|
|
|
|
// Erstelle Supabase-Client mit unterschiedlichen Konfigurationen je nach Umgebung
|
|
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
|
|
auth: isBrowser
|
|
? {
|
|
storage: AsyncStorage,
|
|
autoRefreshToken: true,
|
|
persistSession: true,
|
|
detectSessionInUrl: false,
|
|
}
|
|
: {
|
|
// Dummy-Storage für serverseitiges Rendering
|
|
storage: {
|
|
getItem: () => Promise.resolve(null),
|
|
setItem: () => Promise.resolve(),
|
|
removeItem: () => Promise.resolve(),
|
|
},
|
|
autoRefreshToken: false,
|
|
persistSession: false,
|
|
detectSessionInUrl: false,
|
|
},
|
|
});
|