managarten/apps/context/apps/mobile/utils/supabase.ts
Till-JS bb0e0cf5cb 🚚 feat(context): integrate context app into monorepo
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>
2025-12-05 15:09:04 +01:00

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,
},
});