Skip to content
Snippets Groups Projects

SPADE Node - JS Client

A client-side JavaScript library that can be used to interact with Data Broker's API.

Installation

Install the package via npm:

npm i spade-node-js-client

Link to project https://www.npmjs.com/package/spade-node-js-client

Usage

Import the DataBroker class and create an instance with your configuration:

import { DataBroker } from 'data-broker-client';

const config = {
  url: 'example.com',
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret'
};

const dataBroker = new DataBroker(config);

API

Healthcheck

Retrieve the health status of the Data Broker:

dataBroker.healthcheck().then((status) => {
  console.log(status);
});

Items

Run a discovery on the Data Broker and return a list of items:

dataBroker.items('$').then((items) => {
  console.log(items);
});

Consumption

Retrieve the value read from a property of an Item:

dataBroker.consumption('item-oid', 'property-pid').then((value) => {
  console.log(value);
});

Who do I talk to?

Developed by bAvenir:

License

Copyright (C) 2024 bAvenir

This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0