Type of the fetch config option: the call the client makes. It is only ever called with a
string URL, as fetch(url) or fetch(url, init), and must resolve to a standard Response.
When init carries the X-Api-Key header it also sets redirect: 'manual'; a custom fetch
should honour it (or not follow redirects at all) so the key never reaches another origin.
globalThis.fetch, vi.fn() mocks, the fetch from createX402Fetch() and string-only custom
fetches ((url: string, init?: RequestInit) => Promise<Response>) all fit.
Type of the
fetchconfig option: the call the client makes. It is only ever called with a string URL, asfetch(url)orfetch(url, init), and must resolve to a standardResponse. Wheninitcarries theX-Api-Keyheader it also setsredirect: 'manual'; a custom fetch should honour it (or not follow redirects at all) so the key never reaches another origin.globalThis.fetch,vi.fn()mocks, the fetch fromcreateX402Fetch()and string-only custom fetches ((url: string, init?: RequestInit) => Promise<Response>) all fit.