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
invokeOptions
Optional
FunctionInvokeOptionsobject with the following properties
headers
: object representing the headers to send with the request
body
: the body of the request
responseType
: how the response should be parsed. The default is json
const { data, error } = await supabase.functions.invoke('hello', {
body: JSON.stringify({ foo: 'bar' })
})