Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@bavenir/spade-node-js-client

matej_kokol92EPL-2.01.2.7TypeScript support: included

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

data-broker, data-broker-client, data-integration, data-management, data-retrieval, bAvenir

readme

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 @bavenir/spade-node-js-client

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

Usage

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

import { DataBroker } from '@bavenir/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.discovery('$').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