Invoke a function
Invokes a function
Invokes a Supabase Function.
- Requires an Authorization header.
- Invoke params generally match the Fetch API spec.
Parameters
- functionNameREQUIREDstring
The name of the Function to invoke.
- optionsOptionalFunctionInvokeOptions
Options for invoking the Function.
bodyOptionalobjectThe body of the request.
headersOptionalobjectObject representing the headers to send with the request.
methodOptional"POST" | "GET" | "PUT" | "PATCH" | "DELETE"The HTTP verb of the request
const { data, error } = await supabase.functions.invoke('hello', {
body: JSON.stringify({ foo: 'bar' })
})