Invokes a Supabase Edge Function.
Invokes a function
Invokes a Supabase Edge Function.
- Requires an Authorization header.
- Invoke params generally match the Fetch API spec.
Parameters
functionName
REQUIRED
stringThe name of the Function to invoke.
options
Optional
FunctionInvokeOptionsOptions for invoking the Function.
body
Optional
objectThe body of the request.
headers
Optional
objectObject representing the headers to send with the request.
method
Optional
"POST" | "GET" | "PUT" | "PATCH" | "DELETE"The HTTP verb of the request
region
Optional
FunctionRegionThe Region to invoke the function in.
UsWest2
Optional
"us-west-2"UsWest1
Optional
"us-west-1"UsEast1
Optional
"us-east-1"SaEast1
Optional
"sa-east-1"EuWest3
Optional
"eu-west-3"EuWest2
Optional
"eu-west-2"EuWest1
Optional
"eu-west-1"EuCentral1
Optional
"eu-central-1"CaCentral1
Optional
"ca-central-1"ApSoutheast2
Optional
"ap-southeast-2"ApSoutheast1
Optional
"ap-southeast-1"ApSouth1
Optional
"ap-south-1"ApNortheast2
Optional
"ap-northeast-2"ApNortheast1
Optional
"ap-northeast-1"Any
Optional
"any"
const { data, error } = await supabase.functions.invoke('hello', {
body: JSON.stringify({ foo: 'bar' })
})