@scaleoutsoftware/digital_twin_client
v0.1.7
Published
Client library for ScaleOut Digital Twin Builder
Downloads
2
Keywords
Readme
ScaleOut Digital Twin Builder Client
This package serves as a generic message poster for ScaleOut Digital Twin Builder (TM). It allows client programs written in Javascript to send messages to real-time digital twin instances running in the ScaleOut Digital Twin Streaming Service (TM) or ScaleOut StreamServer (TM). For more information, please see the ScaleOut Digital Twin Streaming Service User Guide.
Installation
npm install @scaleoutsoftware/digital_twin_client
API Documentation
sendToTwin(modelName, modelId, messages...)
Sends one or more messages to a specified Digital Twin instance.
Returns 1 if successful; < 0 if an error occurred.
Parameters
modelName (string) - Name of the Digital Twin model for which to send the message.
modelId (string) - ID of the Digital Twin instance for which to send the message.
messages... (string) - JSON-encoded (i.e., via JSON.stringify()) message(s) to send to the specified Digital Twin instance.
Usage
const dtclient = require('@scaleoutsoftware/digital_twin_client');
let msg = {
hr: 90,
ts: Date.now()
};
let messageSent = dtclient.sendToTwin("HeartRateTracker", "JohnDoe", JSON.stringify(msg));
Other Documentation
Please visit the ScaleOut Software Documentation page for additional information on the ScaleOut Digital Twin Builder.
For support information and options, please visit https://www.scaleoutsoftware.com/scaleout-support/.