Creates a Supabase client scoped to the caller's context.
Configured with a publishable key and (optionally) the caller's JWT, so Row-Level Security policies apply. Stateless — one client per request.
Optional
EnvError If SUPABASE_URL is missing or the specified publishable key is not found.
SUPABASE_URL
const { data: auth } = await verifyAuth(request, { allow: 'user' })const supabase = createContextClient({ auth: { token: auth.token, keyName: auth.keyName },})const { data } = await supabase.rpc('get_my_items') Copy
const { data: auth } = await verifyAuth(request, { allow: 'user' })const supabase = createContextClient({ auth: { token: auth.token, keyName: auth.keyName },})const { data } = await supabase.rpc('get_my_items')
Creates a Supabase client scoped to the caller's context.
Configured with a publishable key and (optionally) the caller's JWT, so Row-Level Security policies apply. Stateless — one client per request.