The incoming HTTP request.
Optionaloptions: WithSupabaseConfigAuth modes, environment overrides. The cors option is ignored here.
{ data: SupabaseContext, error: null } on success, { data: null, error: AuthError } on failure.
const { data: ctx, error } = await createSupabaseContext(request, { auth: 'user' })
if (error) {
// `toJSON()` yields { source, code, message, hint, docs, details }
return Response.json(error.toJSON(), { status: error.status })
}
const { data } = await ctx.supabase.rpc('get_my_items')
Creates a SupabaseContext directly from a request.
Use this when you need the context without the full withSupabase wrapper — e.g., inside framework route handlers or custom middleware. Returns a result tuple instead of producing a
Response.