Spaces:
Running
Running
File size: 560 Bytes
30a3fac | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import { createClient } from '@supabase/supabase-js';
import dotenv from 'dotenv';
dotenv.config();
const { SUPABASE_URL, SUPABASE_KEY } = process.env;
if (!SUPABASE_URL || !SUPABASE_KEY) {
console.error('Missing SUPABASE_URL or SUPABASE_KEY in environment (.env).');
process.exit(1);
}
// Service-role client — server-side only. Never expose the key to the browser.
export const supabase = createClient(SUPABASE_URL, SUPABASE_KEY, {
auth: { persistSession: false }
});
export const STORAGE_BUCKET = process.env.STORAGE_BUCKET || 'ticket-images';
|