The official REST API client for the WEGnology IoT platform (formerly Losant). Version 2.12.5 is the latest stable release, updated irregularly. Provides an easy way to interact with all WEGnology API endpoints, supporting both Node.js (v0.12+) and browser environments. Uses Axios under the hood. Differentiators: it is the first-party client maintained by WEGnology, offering direct support for device and user authentication, promise and callback interfaces, and full coverage of the platform API. Compared to generic HTTP clients, it abstracts authentication and provides resource-specific methods.
npm install wegnology-restNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Authenticates as a device and sends a state update. Uses environment variables for credentials.
Use: const { createClient } = require('wegnology-rest'); or const client = require('wegnology-rest').createClient();Use .then() and .catch() instead of callbacks.
After authentication, call client.setOption('accessToken', response.token);Use the new API structure: client.resource.action(). Refer to migration guide.
Update to version 2.0.0 or later, or use the old method name for older versions.
After authenticateDevice, store the token via client.setOption('accessToken', response.token).Run npm install wegnology-rest. Then use import { createClient } from 'wegnology-rest';Use const { createClient } = require('wegnology-rest'); const client = createClient();