Keeping track of x-ratelimit-remaining while using the node.js client

I’m using the Pipedrive node.js client and need to keep track of x-ratelimit-remaining and related header fields while performing requests, so that I can back off when going too fast. I can’t figure out how to get that info from e.g. pipedrive.Deal.update. What’s the best way to go about this? Does anyone have some sample code which does this?

Any help greatly appreciated!

Hello there :slight_smile:
Never tried node.js, but it all depends on what node module you’re using to connect to the Pipedrive API.
Usually you will have some request object with a header attached you can read from.

Yes, this is more or less the problem. The Pipedrive node.js client wraps a http-library, and the response object. I’m wondering how to get access to that.