5.0.0-next.0
Pre-release
Pre-release
Breaking Changes
General
- migrate to pure ESM (ad34ab2)
The package is now pure ESM. Synchronous loading viarequire(esm)is still possible on the following Node.js versions:v20.19.0+,v22.12.0+, andv23.0.0+.
Note: Synchronousrequire(esm)will fail if the module (or its dependencies) contains top-level await. In such cases, or on older Node.js versions, you must use dynamic import (await import(package)) instead.
auth
- added pluggable token storage (cab3829)
Users can now provide a custom token storage (e.g., Redis-based) by implementing theAuthStorageinterface. In-memory storage remains the default. This change makes allRefreshingAuthProvidermethods asynchronous. The following methods now return a Promise and must be awaited:hasUser(),addUser(),removeUser(), andgetScopesForUser().
api
-
removed
clientSecretparameters fromDonationAlertsMerchandiseApiendpoints (49a0663)
Authentication providers now include aclientSecretaccessor, allowing the secret to be retrieved automatically by internal logic. TheclientSecretparameter is no longer required forcreateMerchandise(),updateMerchandise(),createOrUpdateMerchandise(), andsendSaleAlert()methods. -
added pagination details to
getDonations()method (d102300)
NowgetDonations()method result contains both data and pagination details.
const result = await apiClient.donations.getDonations(123456789, { page: 2 });
console.log(result.data); // array of donations
console.log(result.pagination); // pagination details, can be used for the next request- update rate limiter and provide new request options (a4f3cf7)
Rate limiter can now be replaced with custom implementation (e.g., Redis-based). By default, same-process in-memory limiter is used.
Also, all API methods acceptrequestOptionswhere you can override rate limit or fetch options.
See Rate Limits and Request Options for more details.
Deprecations
api
getAllDonations()method fromDonationAlertsDonationsApiis deprecated (be615d2)
Fetching all donations at once is generally a bad idea. Prefer using a paginator (createDonationsPaginator() method) to request pages sequentially and process them as they are received.
If you absolutely must retrieve all donations in a single operation, use paginator.getAll() method.
Features
auth
- added
clientSecretaccessor to authentication providers (6687426)
api
- added
getUserDataFromPromocode()to fetch user data from a promocode (f4fe993)
Fixes
auth
- add missing type export for
RefreshingAuthProviderConfig(b2949ad)
api
- fix merchant type in
DonationAlertsMerchandiseJsoninterface (3e06017)