import { createClient } from '@supabase/supabase-js';

const requiredEnv = ['SUPABASE_URL', 'SUPABASE_SERVICE_ROLE_KEY'];
requiredEnv.forEach((key) => {
  if (!process.env[key]) {
    console.error(`Missing required Supabase env var: ${key}`);
    process.exit(1);
  }
});

export const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_ROLE_KEY);
