diff --git a/lib/supabase.ts b/lib/supabase.ts index 224e563f..e336cba2 100644 --- a/lib/supabase.ts +++ b/lib/supabase.ts @@ -1,11 +1,15 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; import { createClient } from '@supabase/supabase-js'; +import { useState } from 'react'; import 'react-native-url-polyfill/auto'; -const supabaseUrl = 'https://kvfpmjezholwvgdmabhr.supabase.co'; -const supabaseAnonKey = - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imt2ZnBtamV6aG9sd3ZnZG1hYmhyIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTUwNzAzMDIsImV4cCI6MjAxMDY0NjMwMn0.e6CFmLq4kjNnoGzHDd_hVSUZI6gHaDU-dWu_1Uhd6Mk'; +const [supabaseUrl, setSupabaseUrl] = useState(''); +const [supabaseAnonKey, setSupabaseAnonKey] = useState(''); +if (process.env.SUPABASE_URL && process.env.SUPABASE_ANON_KEY) { + setSupabaseUrl(process.env.SUPABASE_URL); + setSupabaseAnonKey(process.env.SUPABASE_ANON_KEY); +} export const supabase = createClient(supabaseUrl, supabaseAnonKey, { auth: { storage: AsyncStorage,