()
| 2 | import { Database } from '@/types/database.types' |
| 3 | |
| 4 | export function createSupabaseClient() { |
| 5 | const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL |
| 6 | const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY |
| 7 | |
| 8 | if (!supabaseUrl || !supabaseAnonKey) { |
| 9 | throw new Error( |
| 10 | 'Missing Supabase environment variables. Please set NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY.' |
| 11 | ) |
| 12 | } |
| 13 | |
| 14 | // The createBrowserClient from @supabase/ssr handles cookies automatically |
| 15 | // in browser environments with the correct settings for production |
| 16 | return createBrowserClient<Database>( |
| 17 | supabaseUrl, |
| 18 | supabaseAnonKey |
| 19 | ) |
| 20 | } |
no outgoing calls
no test coverage detected