mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 23:41:22 +02:00
Restructure the context app (formerly basetext) to follow the monorepo pattern with proper workspace configuration. Changes: - Move app files to apps/context/apps/mobile/ - Rename package to @context/mobile - Update bundle ID to com.manacore.context - Create pnpm-workspace.yaml for project workspace - Add dev scripts to root package.json - Update CLAUDE.md with project documentation The app structure is prepared for future web/backend additions. Note: Existing TypeScript errors in the original codebase are preserved. These should be fixed in a follow-up PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
768 B
TypeScript
23 lines
768 B
TypeScript
import { createClient } from '@supabase/supabase-js';
|
|
|
|
const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL;
|
|
const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY;
|
|
|
|
// Prüfen, ob wir in einer Browser-Umgebung sind
|
|
const isBrowser = typeof window !== 'undefined';
|
|
|
|
// Nur AsyncStorage importieren, wenn wir in einer Browser-/React Native-Umgebung sind
|
|
let AsyncStorage;
|
|
if (isBrowser) {
|
|
// Dynamischer Import, um SSR-Probleme zu vermeiden
|
|
AsyncStorage = require('@react-native-async-storage/async-storage').default;
|
|
}
|
|
|
|
export const supabase = createClient(supabaseUrl || '', supabaseAnonKey || '', {
|
|
auth: {
|
|
storage: isBrowser ? AsyncStorage : undefined,
|
|
autoRefreshToken: true,
|
|
persistSession: isBrowser,
|
|
detectSessionInUrl: false,
|
|
},
|
|
});
|