opensensemap-client

openSenseMap Client

Based on API version: v11.2.0

NPM

Install

yarn add opensensemap-client

Usage

Usage in TypeScript (with ES Modules):

import * as client from 'opensensemap-client';

async function start() {
// Get information about a senseBox
const r = await client.getBox('57000b8745fd40c8196ad04c').catch((e) => console.error(e));

console.log(JSON.stringify(r));

// Post new sensor data
const data: client.PostNewMeasurementsParamData = [];
const authToken = 'Your senseBox token';

data.push({
sensor: 'Your sensorId',
value: 'Your data'
});

client.postNewMeasurements('Your senseBoxId', data, authToken).catch(console.error);
}

start();

Listed functions according to API documentation of openSenseMap

You can find more information in the full documentation 📖.

OpenSenseMap API documentation

This library was created with a lot of work, reading the code from the OpenSenseMap-API by hand. In addition, this library provides an Insomnia file for debugging purposes.

📄 Insomnia file

Import this file into Insomnia, install the plugins customtimestamp and save-variables and configure the environments if you needed. You are ready!


Author

👤 KillerJulian info@killerjulian.de

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Generated using TypeDoc