Node.js Unified SDK v6.0.0

We are releasing the next major version of the Node.js SDK - version 6.0.0. There are some minor incompatibilities due to the updating and correction of some field types, but the overall implementation is similar to 5.0.0.

Highlights

Better Exceptions in the SDK

We are now passing through error messaging from the API rather than having custom messaging in the SDK itself. This will make it easier to diagnose issues for anyone implementing the SDK. This also simplifies the exception handling implementation while making it more extensible.

Node.js 20 and 21 support

The SDK now officially supports Node.js 20 and 21. While it worked in the past, tests are now run against 18.x, 19.x, 20.x, and 21.x versions of Node.js in GitHub Actions. We will also be adding Node.js 22 support in the coming weeks.

Update Fields

There were a handful of types that were not matching the API, which could throw errors since we use Zod for runtime validation. These have been addressed in version 6.0.0.

We've also identified a handful of missing fields from the API and added them to the SDK.

  • Sometimes, the API responds with an array of errors, so we've added support for that
  • Fields that are optional have been updated in their type definitions
  • Invoice refundAddresses have been added
  • Invoice Transaction exRates and outputIndex have been added
  • Payout Transactionn confirmations have been added
  • Invoice Buyer Fields have been typed
  • Invoice Webhooks and associated fields have been typed
  • Payout Webhooks and associated fields have been typed
  • Refund Webhooks and associated fields have been typed
  • Subscriptions have been removed
  • Wallet has been typed

Code Examples

While we feel the development documentation is helpful at a high-level, we've added code examples to the repo so that they're quickly available to anyone who implements or works on the SDK.

Full Changelog: https://github.com/bitpay/nodejs-bitpay-client/compare/5.0.2...6.0.0