Sanity Library Reference Docs
    Preparing search index...
    • Invokes another Sanity Function.

      By default the invocation is async: the payload is handed off to the function's event source and nothing is returned. Pass {sync: true} to invoke the function and wait for its return value.

      Type Parameters

      • T = unknown

      Parameters

      • name: string

        Name of the function to invoke

      • payload: FunctionPayload

        The {event, context} envelope to deliver

      • options: InvokeOptions & { sync: true }

        Set sync: true to wait for and return the function's result

      Returns Promise<T>

    • Invokes another Sanity Function.

      By default the invocation is async: the payload is handed off to the function's event source and nothing is returned. Pass {sync: true} to invoke the function and wait for its return value.

      Parameters

      • name: string

        Name of the function to invoke

      • payload: FunctionPayload

        The {event, context} envelope to deliver

      • Optionaloptions: InvokeOptions & { sync?: false }

        Set sync: true to wait for and return the function's result

      Returns Promise<void>