Javascript Reference v1.0

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
    string

    the name of the function to invoke

    invokeOptions
    Optional
    FunctionInvokeOptions

    object 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' })
})