clickhouse-js
clickhouse-js copied to clipboard
Use custom fetch(er) for the web client
Use case
By default the web client uses the global fetch. The idea is to configure the client with a custom fetch(er) that may decorate the fetch function with additional functionality. A use case for this could be -
Using mTLS: Cloudflare Workers can use mTLS with added bindings, the binding exposes a fetch(er) with mTLS pre-configured
Describe the solution you'd like
const client = createClient({
// A custom fetcher with decorated functionality, in this case a Cloudflare Worker binding with a fetcher preconfigured with mTLS
fetcher: cloudflareEnv.MY_CERT.fetch
})
Additional context
https://developers.cloudflare.com/workers/runtime-apis/bindings/mtls