Based on API version: v11.2.0
yarn add opensensemap-client
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();
getBox()
getBoxes()
postNewBox()
updateBox()
deleteBox()
claimBox()
getSketch()
getBoxLocations()
getTransfer()
createTransfer()
removeTransfer()
updateTransfer()
postNewMeasurement()
getData()
deleteMeasurements()
getDataByGroupTag()
getDataMulti()
getLatestMeasurements()
getLatestMeasurementOfSensor()
postNewMeasurements()
getStatistics()
printRoutes()
register()
deleteUser()
getUser()
refreshAuth()
signIn()
signOut()
updateUser()
confirmEmail()
getUserBox()
getUserBoxes()
resendEmailConfirmation()
requestPasswordReset()
passwordReset()
You can find more information in the full 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.
Import this file into Insomnia, install the plugins customtimestamp
and save-variables
and configure the environments if you needed. You are ready!
👤 KillerJulian info@killerjulian.de
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