This commit is contained in:
2026-06-25 15:15:15 +02:00
parent 1f032dc098
commit 906e37e845
3 changed files with 513 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { createClient, SupabaseClient } from "@supabase/supabase-js"
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL || ""
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY || ""
let client: SupabaseClient | null = null
if (supabaseUrl && supabaseAnonKey) {
client = createClient(supabaseUrl, supabaseAnonKey)
}
export function getSupabase(): SupabaseClient {
if (!client) {
throw new Error("Supabase is not configured. Set NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY environment variables.")
}
return client
}