Skip to content
Snippets Groups Projects
Matej Kokol's avatar
Matej Kokol authored
Updates type definitions for `PropertiesTD` and `UriVariableTD` interfaces to allow for optional and undefined values. Adds `UriVariableContentTD` interface to represent URI variable content in Thing Descriptions.

Fixes #N/A
2242f8c0
History

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