ttn v2.3.3
The Things Network Node.js Application SDK
This is the Node.js Application SDK for The Things Network to receive activations and messages from IoT devices via The Things Network and send messages as well.
Installation 
npm install --save ttnNOTE: To use this SDK with the deprecated staging environment, install version 1.3.2 instead:
npm i --save ttn@1.3.2.
Documentation
Example
import { data, application } from "ttn"
const appID = "foo"
const accessKey = "ttn-account.eiPq8mEeYRL_PNBZsOpPy-O3ABJXYWulODmQGR5PZzg"
// discover handler and open mqtt connection
data(appID, accessKey)
.then(function (client) {
client.on("uplink", function (devID, payload) {
console.log("Received uplink from ", devID)
console.log(payload)
})
})
.catch(function (err) {
console.error(err)
process.exit(1)
})
// discover handler and open application manager client
application(appID, accessKey)
.then(function (client) {
return client.get()
})
.then(function (app) {
console.log("Got app", app)
})
.catch(function (err) {
console.error(err)
process.exit(1)
})There are more examples in the examples/ directory. For examples
written in ES5 (instead of ES2015), check the examples/es5/
directory.
Test 
To run the tests:
yarn install
make testQuality
The code is written in ES7 using flowtype type annotations.
To run the typechecker:
make typecheck To run the linter:
make qualityBuild
To build the repository and transpile to ES5, run:
make buildInstall git hooks
To avoid checking in code with type- and linter-errors, install commit hooks via
make git.hooksReleasing
Tags are released through travis automatically. If you want to release manually run:
$ npm publish6 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago