
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
agile-sdk-test-version
Advanced tools
The official JavaScript Agile IoT SDK.
The intention of this module is to provide developers a nice API to integrate their JavaScript applications with Agile IoT Gateway.
Install the Agile SDK by running:
$ npm install --save agile-sdk
The module exports a single factory function that takes an object including your Agile API hostname as the api property. Additionally, it can receive the idm url and a token.
It's available in node.js and the browser.
var agile = require('agile-sdk')({
api: 'http://agile.local:8080',
idm: 'http://agile.local:3000',
token: "LQCL7C14y84Ayqedjmbm1LuIes1TsSyn5Cv"
})
For convenience it's shipped with a browser bundle too with agileSDK expose as a global constant eg.
<script src="node_modules/agile-sdk/dist/bundle.js"></script>
<script>
var agile = agileSDK({
api: 'http://agile.local:8080',
idm: 'http://agile.local:3000',
token: "LQCL7C14y84Ayqedjmbm1LuIes1TsSyn5Cv"
});
agile.protocolManager.discovery.start()
.then(function() {
console.log('started!')
})
.catch(function(err) {
console.log(err)
});
</script>
Here a example of reading data from a device:
import agileSDK from 'agile-sdk';
const agile = agileSDK({
api: 'http://agile.local:8080',
idm: 'http://agile.local:3000',
token: "LQCL7C14y84Ayqedjmbm1LuIes1TsSyn5Cv"
});
const deviceId = 'bleB0B448BE5084';
const componentID = 'Temperature';
agile.device.subscribe(deviceId, componentID).then(stream => {
stream.onerror = () => {
console.log('Connection Error');
};
stream.onopen = () => {
console.log('Connected');
};
stream.onclose = () => {
console.log('Closed');
};
stream.onmessage = (e) => {
if (typeof e.data === 'string') {
console.log("Received: '" + e.data + "'");
}
};
}).catch(err => {
console.log(err);
});
The change log is automatically managed by versionist. View full change log.
If you're having any problem, please raise an issue on GitHub and the team will be happy to help.
npm run test
FAQs
test version of the javascript wrapper for agile-iot sdk
The npm package agile-sdk-test-version receives a total of 2 weekly downloads. As such, agile-sdk-test-version popularity was classified as not popular.
We found that agile-sdk-test-version demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.