Add Supabase client and env template

This commit is contained in:
EugeneTes
2026-08-15 11:52:31 +00:00
parent 94fe6d3358
commit 22240c89e8
2 changed files with 15 additions and 0 deletions

3
frontend/.env.example Normal file
View File

@@ -0,0 +1,3 @@
VITE_SUPABASE_URL=https://YOURPROJECT.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_YOURKEY
VITE_API_URL=http://localhost:5057

View File

@@ -0,0 +1,12 @@
import { createClient } from '@supabase/supabase-js';
const url = import.meta.env.VITE_SUPABASE_URL;
const publishableKey = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY;
if (!url || !publishableKey) {
throw new Error(
'Missing VITE_SUPABASE_URL or VITE_SUPABASE_PUBLISHABLE_KEY. Copy .env.example to .env.local and fill it in.'
);
}
export const supabase = createClient(url, publishableKey);