Skip to main content

Upgrade JavaScript SDK 2.x to 3.x

How to upgrade from SDK version 2.x to 3.x.

Renamed interfaces

Some TypeScript interfaces have been renamed to have consistency between different resource types. The most used ones are:
  • GetTimeSeriesMetadataDTO -> Timeseries
  • PostTimeSeriesMetadataDTO -> ExternalTimeseries
  • DatapointsGetAggregateDatapoint -> DatapointAggregates
  • FilesMetadata -> FileInfo
You can find a comprehensive list in the changelog.

Events aggregate endpoints moved to a sub-API

  • client.events.aggregate(...) -> client.events.aggregate.count()
  • client.events.uniqueValuesAggregate(...) -> client.events.aggregate.uniqueValues(...)

Timestamp-to-Date auto-conversion

The JavaScript SDK automatically converts response timestamp values to date objects. This caused a bug in the Raw API. The fix can introduce a breaking change if you use the Raw API, and possibly in other places.

Helper classes removed

AssetClass, TimeSeriesClass, TimeSeriesList, and AssetList contained some helper methods that have been removed. Most of these helpers can be re-implemented using other SDK calls. Some examples: Asset.delete()
Asset.subtree()
TimeSeriesList.getAllDatapoints(…)

Removed client.assets.retrieveSubtree(…)

Copies the functionality of Asset.subtree() (read above).

Change filter passing to client.timeseries.list

The function previously took a TimeseriesFilter as input and now takes a TimeseriesFilterQuery, which corresponds to the API spec. All filter-related fields should now be in the filter object.

Example

Upgrade JavaScript SDK 1.x to 2.x

How to upgrade from SDK version 1.x to 2.x.

Constructor

In 2.x.x, you need to create a new SDK instance before you can use the SDK:
Next, you need to authenticate your client by calling one of these methods on the client: With API key:
With OAuth:
For more info about OAuth-authentication, see here.

Changes

Last modified on April 23, 2026