Tells the Data API client to use the native fetch API for making HTTP requests.
See HttpOptions for the other options available.
Optional maxThis temporary error-ing property exists for migration convenience, and will be removed in a future version.
maxTimeMS option is no longer available here; the timeouts system has been overhauled, and defaults should now be set using the timeoutDefaults option.
Overview
The default http client used by the Data API client, which is the native
fetchAPI.Passing in
httpOptions: { client: 'fetch' }is equivalent to not setting thehttpOptionsat all.Polyfilling
fetchSee https://github.com/BuilderIO/this-package-uses-fetch for info about polyfilling fetch for your environment.
Customizing
fetchYou may extend the
FetchNativeclass to customize thefetch'sRequestInit, for example to use a custom UndiciDispatcherto further customize the HTTP options.See the below-mentioned
examples/customize-httpdirectory for examples & more information about extendingFetchNative.Examples
For advanced examples & more information, see the
examples/customize-httpdirectory in the astra-db-ts repositorySee
HttpOptions