add les 12
This commit is contained in:
19
Les12-Tool-Calling/polderfest-demo/lib/supabase-admin.ts
Normal file
19
Les12-Tool-Calling/polderfest-demo/lib/supabase-admin.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import "server-only";
|
||||
|
||||
import { createClient } from "@supabase/supabase-js";
|
||||
|
||||
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
|
||||
const supabaseServiceRoleKey = process.env.SUPABASE_SERVICE_ROLE_KEY;
|
||||
|
||||
if (!supabaseUrl) {
|
||||
throw new Error("Missing env var: NEXT_PUBLIC_SUPABASE_URL");
|
||||
}
|
||||
|
||||
if (!supabaseServiceRoleKey) {
|
||||
throw new Error("Missing env var: SUPABASE_SERVICE_ROLE_KEY");
|
||||
}
|
||||
|
||||
export const supabaseAdmin = createClient(supabaseUrl, supabaseServiceRoleKey, {
|
||||
auth: { persistSession: false },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user