Official Node.js client for the BindThings IoT Platform.
npm install bindthings-sdkconst { BindThings } = require('bindthings');
const bt = new BindThings('YOUR_DEVICE_TOKEN');
async function main() {
await bt.connect();
await bt.send({ temperature: 25.5, humidity: 60 });
}
main();const bt = new BindThings(token, options);await bt.connect(); // Returns Promiseawait bt.send({ temperature: 25.5 });
await bt.send({ temperature: 25.5, humidity: 60, pressure: 1013 });await bt.sendAttributes({ firmware: '1.0.0', model: 'ESP32' });bt.onCommand((payload) => {
const data = JSON.parse(payload);
console.log(data);
});bt.isConnected(); // Check connection
bt.disconnect(); // Graceful disconnect| Example | Description |
|---|---|
| basic.js | Send temperature and humidity every 15 seconds |
| sensor.js | Multi-sensor with attributes |
| Parameter | Value |
|---|---|
| Broker | mqtts://mqtt.bindthings.io:8883 |
| Username | Your Device Token |
| Password | Your Device Token |
MIT License — © 2025 BindThings