Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including mym2m-client with all npm packages installed. Try it out:

'use strict'; var mym2m = require('mym2m-client'); // create a new API client with your device key and unit identifier var myDevice = new mym2m.API('YOUR-DEVICE-KEY', 'UNIT00001'); // create a snapshot with some sample data var snapshot = new mym2m.Snapshot(); snapshot.setChannel('temp', 25); snapshot.setChannel('humid', 40); // add the snapshot myDevice.add(snapshot); // dispatch! myDevice.dispatch() .catch(function(result) { console.log(result); console.error('Dispatch failed. You can inspect result.response and result.error to debug.'); });

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

mym2m-client v0.0.4

Node SDK for the MyM2M Web JSON Device API

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free