2026-03-28 16:02:59 -05:00
|
|
|
import { createClient } from '@supabase/supabase-js'
|
|
|
|
|
|
2026-03-29 19:30:46 -05:00
|
|
|
const url = process.env.SUPABASE_URL
|
|
|
|
|
const key = process.env.SUPABASE_SERVICE_ROLE_KEY
|
|
|
|
|
|
|
|
|
|
if (!url || !key) {
|
|
|
|
|
throw new Error('Faltan variables de entorno: SUPABASE_URL y/o SUPABASE_SERVICE_ROLE_KEY')
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-28 16:02:59 -05:00
|
|
|
// Service Role key: bypasea RLS, solo usar en backend
|
2026-03-29 19:30:46 -05:00
|
|
|
export const supabase = createClient(url, key)
|