Skip to content

Use keepAlive by default for request connections

Compare
Choose a tag to compare
@tdumitrescu tdumitrescu released this 20 May 18:46
· 35 commits to master since this release

The library now defaults to using keepAlive (https://nodejs.org/api/http.html#new-agentoptions) so that each request doesn't have to establish a new connection. This should result in better performance and network reliability. If you need to turn this option off, initialize the library with keepAlive: false:

const mixpanel = Mixpanel.init('<YOUR_TOKEN>', {
  keepAlive: false,
});