Skip to content

5.0.0-next.0

Pre-release
Pre-release

Choose a tag to compare

@StimulCross StimulCross released this 16 Mar 16:24
· 1 commit to main since this release

Breaking Changes

General

  • migrate to pure ESM (ad34ab2)
    The package is now pure ESM. Synchronous loading via require(esm) is still possible on the following Node.js versions: v20.19.0+, v22.12.0+, and v23.0.0+.
    Note: Synchronous require(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 the AuthStorage interface. In-memory storage remains the default. This change makes all RefreshingAuthProvider methods asynchronous. The following methods now return a Promise and must be awaited: hasUser(), addUser(), removeUser(), and getScopesForUser().

api

  • removed clientSecret parameters from DonationAlertsMerchandiseApi endpoints (49a0663)
    Authentication providers now include a clientSecret accessor, allowing the secret to be retrieved automatically by internal logic. The clientSecret parameter is no longer required for createMerchandise(), updateMerchandise(), createOrUpdateMerchandise(), and sendSaleAlert() methods.

  • added pagination details to getDonations() method (d102300)
    Now getDonations() 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 accept requestOptions where you can override rate limit or fetch options.
    See Rate Limits and Request Options for more details.

Deprecations

api

  • getAllDonations() method from DonationAlertsDonationsApi is 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 clientSecret accessor 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 DonationAlertsMerchandiseJson interface (3e06017)