Skip to main content

Semantic versioning

Official Bachs SDKs follow semantic versioning. For a version MAJOR.MINOR.PATCH:
  • Major releases can break your code, for example by renaming a method or changing a type. Read the changelog before you upgrade.
  • Minor releases add features, such as a new resource or method, without breaking existing code.
  • Patch releases fix bugs.
Pre-releases let you try a version before it is final. For Node.js, a version with a hyphen, such as 1.1.0-rc.1, is a pre-release, published under the npm next tag, so npm install @bachs/sdk never installs one. For Python, versions such as 1.1.0rc1 are pre-releases, and pip install bachs never installs one. Install a pre-release by name only when you want to try it.

SDK and API versions

The SDK version and the API version are separate. The API is versioned in its path, /v1. SDK 2.x calls API /v1, as 1.x did. When the API adds a field, you can read it from the response before an SDK release types it: responses keep fields the SDK does not know about yet. When the API adds an endpoint, the SDK adds it in a minor release. Until then, call the endpoint directly.

Supported runtimes

The Node.js SDK uses the fetch and crypto built into Node.js. The Python SDK is built on httpx, and its async client runs on asyncio or trio. Both are for servers only and do not support browsers.

Upgrade

Check the version you have:
Update within your current major version:

Upgrade from 1.x to 2.0

2.0 is the first release under the shared SDK foundations, so both SDKs changed their public shape at once. Nothing changed in what they send to the API. Node.js has one breaking change. On BachsApiError and BachsResponseError, the HTTP status code is statusCode instead of status, and on BachsNetworkError it is responseStatusCode instead of responseStatus. errorCode is unchanged. Everything else in 2.0 is new rather than changed: environment is optional, listAll walks every page, and there is a logger option. Python changed how you write requests and read responses:
  • Request fields are keyword arguments: bachs.payouts.create(destination="pd_123", amount="50.00") instead of a dictionary.
  • Responses are typed objects: payout.status instead of payout["status"]. Use .to_dict() where you need the dictionary.
  • The HTTP status code on errors is status_code instead of status, and response_status_code instead of response_status on BachsNetworkError. error_code is unchanged.
  • environment is optional, list_all walks every page, and the SDK logs through the bachs logger.
Every release is listed in each SDK’s changelog: Node.js and Python. Major releases are also announced in the product changelog.
@bachs/sdk version 0.0.1 on npm and bachs version 0.0.1 on PyPI are empty placeholders. If your lockfile has either, upgrade to 2.0.0 or later.