Skip to main content
SDK 0.6 follows the current management API. SDK 0.5 and older call routes that the API no longer serves, so they fail against it.

Install 0.6

The SDK is ESM only and needs Node.js 20.20 or later.

Update the key and host

Rename the STATE_API_KEY variable to STATEMACHINES_API_KEY. The SDK reads only the new name. The default host is now https://api.usestatemachines.com. If your code passes baseUrl: 'https://state-api.usestatemachines.workers.dev', delete that option.

Rename lifecycle calls

Pausing keeps the environment’s data. Deleting removes it. Map each old stop call to delete only where the task is finished with the data.

Update app entries and credentials

For Salesforce SOAP, put credentials.token in SessionHeader/sessionId in the envelope. See credentials and actors.

Update snapshots, requests and identity

Update error handling

Every 0.6 error code uses underscores. Check the error subclasses with instanceof before you read StateMachinesError.code. Never match message text. The SDK error reference lists the classes and codes.

Confirm one complete task

Run the quickstart outside production. Confirm that creation reaches running, the app request succeeds, and deletion completes.

Pin the minor version

A 0.x minor release can include breaking changes. Pin the minor version in package.json so an install does not move you to 0.7: