ttn-lw

3.8.1-beta.1 • Public • Published

The Things Stack for LoRaWAN JavaScript SDK

This is the official SDK for the The Things Stack for LoRaWAN.

Installation

$ yarn add ttn

Usage

Basic Setup

import TTN from 'ttn'
 
const token = 'paste-your-token-here'
const ttn = new TTN(token, {
  connectionType: 'http',
  baseURL: 'http://localhost:1885/api/v3',
  defaultUserId: 'testuser',
})

Creating Applications

const appData = {
  ids: {
    application_id: 'first-app',
  },
  name: 'Test App',
  description: 'Some description',
}
 
// Via Applications object.
const firstApp = await ttn.Applications.create('testuser', appData)
 
// Via Application class.
const secondApp = new ttn.Application(appData)
await secondApp.save()

Development

Building

$ yarn run build

This will transpile the source to /dist

Watching Changes

$ yarn run watch

Testing

$ yarn run jest

Examples

There are some basic usage examples in /src/examples

Readme

Keywords

none

Package Sidebar

Install

npm i ttn-lw

Weekly Downloads

2

Version

3.8.1-beta.1

License

Apache-2.0

Unpacked Size

1.68 MB

Total Files

81

Last publish

Collaborators

  • jancee