Content loader utility, Content directory structuur
This commit is contained in:
20
lib/supabase/client.ts
Normal file
20
lib/supabase/client.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!
|
||||
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
|
||||
|
||||
if (!supabaseUrl || !supabaseAnonKey) {
|
||||
throw new Error('Missing Supabase environment variables. Check your .env.local file.')
|
||||
}
|
||||
|
||||
/**
|
||||
* Supabase client for client-side operations.
|
||||
* Uses anon key - safe for browser/frontend.
|
||||
* Row Level Security (RLS) policies apply.
|
||||
*/
|
||||
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
|
||||
auth: {
|
||||
persistSession: true,
|
||||
autoRefreshToken: true,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user