lnbits-js icon indicating copy to clipboard operation
lnbits-js copied to clipboard

Allow passing in `AxiosRequestConfig` adapter

Open fresheneesz opened this issue 2 years ago • 0 comments

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;

fresheneesz avatar Dec 21 '22 23:12 fresheneesz