consoleFetch

A custom wrapper around fetch that adds console specific headers and allows for retries and timeouts. It also validates the response status code and throws appropriate error or logs out the user if required. It returns a promise that resolves to the response.

Parameter Name Description

url

The URL to fetch

options

The options to pass to fetch

timeout

The timeout in milliseconds