Create server Supabase admin client
cgen-35300bd4c48542b599d9b18b4ea6cc30
This commit is contained in:
parent
084a7f9f49
commit
c4eb0d7db9
1 changed files with 15 additions and 0 deletions
15
server/supabase.ts
Normal file
15
server/supabase.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { createClient } from "@supabase/supabase-js";
|
||||
|
||||
const SUPABASE_URL = process.env.SUPABASE_URL || process.env.VITE_SUPABASE_URL || "";
|
||||
const SUPABASE_SERVICE_ROLE = process.env.SUPABASE_SERVICE_ROLE || "";
|
||||
|
||||
if (!SUPABASE_URL) {
|
||||
console.warn("SUPABASE_URL not set for server");
|
||||
}
|
||||
if (!SUPABASE_SERVICE_ROLE) {
|
||||
console.warn("SUPABASE_SERVICE_ROLE not set for server (admin ops will fail)");
|
||||
}
|
||||
|
||||
export const adminSupabase = createClient(SUPABASE_URL, SUPABASE_SERVICE_ROLE, {
|
||||
auth: { autoRefreshToken: false, persistSession: false },
|
||||
});
|
||||
Loading…
Reference in a new issue