Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ VITE_SUPABASE_ANON_KEY=your-anon-key

# Set to 'false' to disable mock data and use real API
VITE_USE_MOCK=false

# Support email address
VITE_SUPPORT_EMAIL=support@example.com

# YouTube API Key for media integrations
VITE_YOUTUBE_API_KEY=your-youtube-api-key

# Stripe subscription link
VITE_STRIPE_GROWTH_LINK=https://billing.stripe.com/p/mock-link
24 changes: 8 additions & 16 deletions MobileApp/src/lib/supabase.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'react-native-url-polyfill/auto';
import { createClient } from '@supabase/supabase-js';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { SUPABASE_URL, SUPABASE_ANON_KEY } from './config';

const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL;
const supabaseKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY;
Expand All @@ -12,20 +11,13 @@ if (!supabaseUrl || !supabaseKey) {
);
}

if (!SUPABASE_URL || !SUPABASE_ANON_KEY) {
console.error(
'[Supabase] Missing SUPABASE_URL or SUPABASE_ANON_KEY. ' +
'Create a .env file in MobileApp/ with these values. See .env.example.'
);
} else {
supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
auth: {
storage: AsyncStorage,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
});
}
const supabase = createClient(supabaseUrl, supabaseKey, {
auth: {
storage: AsyncStorage,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
});

export { supabase };