Semantic versioning
Official Bachs SDKs follow semantic versioning. For a versionMAJOR.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.
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: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. OnBachsApiError 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.statusinstead ofpayout["status"]. Use.to_dict()where you need the dictionary. - The HTTP status code on errors is
status_codeinstead ofstatus, andresponse_status_codeinstead ofresponse_statusonBachsNetworkError.error_codeis unchanged. environmentis optional,list_allwalks every page, and the SDK logs through thebachslogger.

