Versions and runtimes

Where the SDK runs, how it is versioned, and moving to it from the REST API.

Runtimes

RuntimeSupported
Node.js20 and later
Bun, DenoCurrent releases
Cloudflare Workers, Vercel EdgeYes
BrowsersNo: call the API from your server (see Browsers and apps)

The package has no dependencies. It ships ES modules and CommonJS, with TypeScript types for both.

Versions

The SDK follows semantic versioning:

  • 1.x calls the API's v1 (https://app.swarmhit.com/api/v1).
  • A minor or patch release adds methods, fields and fixes. It never breaks your code.
  • A new major version of the API will come with a new major version of the SDK.

Within v1, the API only adds things: endpoints, fields and enum values. So the SDK's types accept enum values they do not know yet, and a new field your code does not read never gets in the way. When you pass a logger, the SDK logs each method the API marks as deprecated, once, with its sunset date.

The SDK is in beta until 1.0.0. The changelog lists every release.

Coming from the REST API

The SDK calls the same /api/v1 endpoints, with the same API key, and answers with the same fields, minus the { "data": … } envelope. You can move an integration to it one call at a time.

On this page