mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 11:00:47 +02:00
Added to codebase VITE_SUPABASE_URL VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY VITE_STRIPE_PUBLISHABLE_KEY
21 lines
856 B
TypeScript
21 lines
856 B
TypeScript
import { createClient, SupabaseClient } from '@supabase/supabase-js';
|
|
|
|
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL || 'https://rficokptxxxxtyzcvgmx.supabase.co';
|
|
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY || 'sb_publishable_UHz2SVRF5mvdrPHWkRteyA_yNlZTkYb';
|
|
|
|
// Check if Supabase is configured
|
|
export const isSupabaseConfigured = !!(supabaseUrl && supabaseAnonKey);
|
|
|
|
// Create client only if configured, otherwise export null
|
|
export const supabase: SupabaseClient | null = isSupabaseConfigured
|
|
? createClient(supabaseUrl, supabaseAnonKey)
|
|
: null;
|
|
|
|
// Log warning if not configured (for self-hosted installations)
|
|
if (!isSupabaseConfigured) {
|
|
console.warn(
|
|
'Supabase is not configured. Checkout and billing features will be disabled. ' +
|
|
'Static plan information will be displayed instead.'
|
|
);
|
|
}
|