everydaycats commited on
Commit
13be420
·
verified ·
1 Parent(s): 430c534

Create config/supabaseClient.js

Browse files
Files changed (1) hide show
  1. apps/config/supabaseClient.js +13 -0
apps/config/supabaseClient.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // config/supabaseClient.js
2
+ import { createClient } from '@supabase/supabase-js';
3
+ import dotenv from 'dotenv';
4
+ dotenv.config();
5
+
6
+ const supabaseUrl = process.env.SUPABASE_URL;
7
+ const supabaseKey = process.env.SUPABASE_SERVICE_ROLE_KEY; // MUST use Service Role Key for backend admin tasks
8
+
9
+ if (!supabaseUrl || !supabaseKey) {
10
+ console.error("🚨 Missing Supabase Env Variables!");
11
+ }
12
+
13
+ export const supabase = createClient(supabaseUrl, supabaseKey);