0.1.10 • Published 1 year ago
@telefonica/opengateway-javascript-sdk v0.1.10
Dummy aggregator's Open Gateway JavaScript SDK
Copyright (c) Telefonica - All rights reserved
JavaScript SDK of a dummy aggregator implementing Open Gateway capabilities
Installation
This a JavaScript SDK published as a Node.js package. A previous installation of Node.js and an initiation with the npm install
command is needed before installing it.
For installing the SDK just run:
$ npm install @telefonica/opengateway-javascript-sdk
Usage
In two simple steps, you can instantiate the client class for the Open Gateway API you want to use, and then just call a network capability function:
const appCredentials = {
clientId: 'your-app-client-id',
clientSecret: '9999-9999999-999999-99999',
};
const homePublicIp = getClientIp();
const deviceIp = getDeviceLocalIp();
const homeNetwork = new HomeNetwork(appCredentials, homePublicIp);
const device = {
localIpAddress: deviceIp
};
homeNetwork.setQualityOfService(device, NetworkQoSClassification.RealTimeInteractive);
The recommended usage of the SDK is from your backend code. Take a look at the sample project...
Sample project
You'll find a comprehensive sample code implementing Home Devices QoD capability here
Parent sample project
https://github.com/Telefonica/opengateway-homedevices-qod-sample