lnbits-js
lnbits-js copied to clipboard
Allow passing in `AxiosRequestConfig` adapter
Right now lnbits can't be used in a cloudflare worker, because cloudflare workers can only use fetch
to interact. We can use @vespaiach/axios-fetch-adapter
if only we could pass it in. It looks like all the primary source files should be updated to allow passing in the adapter, or probably more general axios config overrides.
My current workaround is to monkey patch the adapter in. Eg:
const { withdraw } = LNBits.default({ ... });
withdraw.api.defaults.adapter = fetchAdapter;