io.backgroundFetch()
allows you to fetch data from a URL that can take longer that the serverless timeout. The actual fetch
request is performed on the Trigger.dev platform, and the response is sent back to you. An example use case is fetching data from a slow API, like some AI endpoints.
run()
. See
resumability for more information.backoff
: Retries the request with an exponential backoff.headers
: Retries the request using info from the response headers.Promise
that resolves with the JSON response body of the background fetch request. You can specify the type of the response body as a generic parameter.