supabase.ts
1import { createClient } from '@supabase/supabase-js'
2import { config } from 'dotenv'
3
4// Load environment variables
5config()
6
7const supabaseUrl = process.env.SUPABASE_URL
8const supabaseKey = process.env.SUPABASE_ANON_KEY
9
10if (!supabaseUrl || !supabaseKey) {
11 throw new Error('Missing Supabase environment variables')
12}
13
14export const supabase = createClient(supabaseUrl, supabaseKey)
15