Files
MotionWebStudio/lib/supabaseClient.ts
2025-12-21 20:40:32 +01:00

27 lines
1.0 KiB
TypeScript

import { createClient } from '@supabase/supabase-js';
// Configuration
// You can switch these to import.meta.env.VITE_SUPABASE_URL if you use a .env file later.
const supabaseUrl = 'https://fhgxhqagvjnjamsyilmh.supabase.co';
const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZoZ3hocWFndmpuamFtc3lpbG1oIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ3NDg2OTMsImV4cCI6MjA4MDMyNDY5M30.t4RhJlqM5f_N7PK3Qx58KhvTl9zZB6KYxLGr_gc_3Ok';
// Validation to ensure keys are not empty or default placeholders
const isPlaceholder =
!supabaseUrl ||
!supabaseAnonKey ||
supabaseUrl.includes('placeholder') ||
supabaseAnonKey.includes('placeholder');
if (isPlaceholder) {
console.warn(
"Missing or invalid Supabase environment variables. Auth features will run in DEMO MODE."
);
}
// Initialize the Supabase client
export const supabase = createClient(
supabaseUrl || 'https://placeholder.supabase.co',
supabaseAnonKey || 'placeholder-key'
);
export const isSupabaseConfigured = !isPlaceholder;