MCPcopy Create free account
hub / github.com/botbotrobotics/BotBrain / createSupabaseClient

Function createSupabaseClient

frontend/src/utils/supabase-client.ts:4–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { Database } from '@/types/database.types'
3
4export 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}

Callers 5

constructorMethod · 0.90
MissionsServiceClass · 0.90
SupabaseProviderFunction · 0.90
connectToRobotFunction · 0.85
initializeRosConnectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected