The pipedrive.ApiClient.instance has been deprecated.
Please, initialise a new pipedrive.ApiClient() instance separately for each request instead.
Yet the example straight after it, doesn't initialise a new AppClient instance separately for each request?
If it were each request, I'd expect something like:
app.get('/', async (req, res) => {
// Initialise a new pipedrive.ApiClient() instance separately for each request
const defaultClient = new pipedrive.ApiClient();
let apiToken = defaultClient.authentications.api_key;
apiToken.apiKey = 'YOUR_API_TOKEN_HERE';
const api = new pipedrive.DealsApi(defaultClient);
const deals = await api.getDeals();
res.send(deals);
});
Hey @timneedham , Yeah, you're right. that's an oversight on our part, we'll update the readme to reflect the recommended way of doing it. thanks for pointing it out!
Hi,
The README states:
Yet the example straight after it, doesn't initialise a new AppClient instance separately for each request?
If it were each request, I'd expect something like: