An open API service indexing awesome lists of open source software.

https://github.com/binarymax/node-relayr

Node.js library for Relayr sensors
https://github.com/binarymax/node-relayr

Last synced: 5 months ago
JSON representation

Node.js library for Relayr sensors

Awesome Lists containing this project

README

          

# node-relayr

Relayr sensor SDK for node.

Works by connecting to the PubNub channel associated with your Relayr WunderBar sensor.

## installation

```
npm install relayr
```

## connecting

Require the module

```js
var relayr = require('relayr');
```

Get the following from your account at relayr.io

```js
var relayrKeys = {
app_id: "YOURAPPID",
dev_id: "YOURDEVICEID",
token: "YOURSENSORTOKEN"
};
```

Connect using the keys:
```js
relayr.connect(relayrKeys);
```

Listen and do stuff
```js
relayr.listen(function(err,data){
//fires for every sensor event
if (err) {
console.log("Oh No!", err)
} else {
console.log(data);
}
});

```