custom may be used for advanced users who want to use their own fetch implementation, or modify an existing one to suit their needs.
For example, if you want to use a custom HTTP Agent/Dispatcher, or modify fetch's RequestInit in any way, you can easily do so by extending the FetchNative class.
For advanced examples & more information, see the examples/customize-http & examples/using-http2 directories in the astra-db-ts repository
Type declaration
ERROR: "ERROR: fetch-h2 is no longer the default client; it must be set using `client: \"fetch-h2\"`. See `FetchH2HttpClientOptions` for more information."
Overview
The options available for the DataAPIClient related to making HTTP requests.
There are three different behaviors for setting the client:
client: 'fetch'or not setting thehttpOptionsat allfetchAPIclient: 'fetch-h2'fetch-h2module for HTTP/2 requestsclient: 'custom'Fetcherimplementation to the clientHTTP/2 support
fetch-h2is a fetch implementation that supports HTTP/2, and may offer notable performance gains.However, it is not included in the SDK by default (for compatability reasons); the module will need to be manually provided by the user.
Luckily, it takes only a couple of easy steps. See FetchH2HttpClientOptions for more information.
Alternatively, if using Node.js, you may use a custom Undici
Dispatcherconfigured to use HTTP/2 withfetchinstead. See below for more information.Using your own Fetcher implementation
custommay be used for advanced users who want to use their own fetch implementation, or modify an existing one to suit their needs.For example, if you want to use a custom HTTP
Agent/Dispatcher, or modifyfetch'sRequestInitin any way, you can easily do so by extending the FetchNative class.See CustomHttpClientOptions for more information.
Examples & more info
For advanced examples & more information, see the
examples/customize-http&examples/using-http2directories in the astra-db-ts repository