initial commit

This commit is contained in:
root
2026-05-29 17:07:00 +02:00
commit c935e39fa1
30 changed files with 1263 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import { createClient, SupabaseClient } from '@supabase/supabase-js';
let _admin: SupabaseClient | null = null;
export function getSupabaseAdmin(): SupabaseClient {
if (_admin) return _admin;
const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
const key = process.env.SUPABASE_SERVICE_ROLE_KEY;
if (!url || !key) {
throw new Error('Supabase admin env not configured');
}
_admin = createClient(url, key, {
auth: { autoRefreshToken: false, persistSession: false },
});
return _admin;
}
export function getSupabaseAnon(): SupabaseClient {
const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
const key = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
if (!url || !key) {
throw new Error('Supabase anon env not configured');
}
return createClient(url, key, {
auth: { autoRefreshToken: false, persistSession: false },
});
}