SynapseFI / SynapseNode

Node.js Client Library for SynapseFI REST V3.1 API | https://docs.synapsefi.com
MIT License
13 stars 36 forks source link

Accept Axios options #76

Open dguo opened 3 years ago

dguo commented 3 years ago

It would be helpful if the client could take an optional parameter for Axios options to pass to the actual Axios calls.

Recently, we have been getting a lot of ETIMEDOUT errors. Based on this StackOverflow answer, we added this:

axios.defaults.timeout = 30000;
axios.defaults.httpsAgent = new https.Agent({ keepAlive: true });

However, this applies to other places where we use Axios, since we're setting them globally. We can't selectively apply it only to the Synapse calls, and it's causing us issues. It would be great if we could pass in the options to the client constructor instead.

jenstroeger commented 3 years ago

I added options to the request itself. See #78.