Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sensor.live-things-registry

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sensor.live-things-registry

## Overview

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
3
Weekly downloads
 
Created
Source

sensor.live-things-registry-javascript

Overview

This document will help your device connect to AWS IoT quickly. Mainly to speed up the process of certificate exchanging complied to AWS IoT authentication.

Prepare

Environment

  • Create "certs" directory in your develop path.

Packages

  • AWS IoT SDK for JavaScript https://github.com/aws/aws-iot-device-sdk-js

sensor.live

  • Enable SATR on sensor.live, you will get root_ca.cert.pem, ca.cert.pem and ca.private_key.pem.
  • Put the pem files into ./certs directory.

Installation

npm install sensor.live-things-registry

Examples

const aws_iot = require('aws-iot-device-sdk');
const thing_registry = require('sensor.live-things-registry');
const config = {
    aws_iot: {
        endpoint: 'your aws iot endpoint',
        port: '8883', // 8883 or 1883 is default supported with AWS IoT,
        debug: false
    }
}
thing_registry.setCertsPath('./certs'); // you can change the default certificates folder
if (!thing_registry.hasDeviceCertificate()) {
    thing_registry.generateDeviceCertificate({
        thing_name: '<YourDeviceUniqueName>'
    });
}
let thing_name = thing_registry.getThingName();
let keys_path = thing_registry.getKeysPath();
let client_id = `device-${thing_name}`
let thing_shadow = aws_iot.thingShadow({
    ...keys_path,
    host: config.aws_iot.endpoint,
    port: config.aws_iot.port,
    debug: config.aws_iot.debug,
    clientId: client_id
});

API Documentation

ThingRegistry.generateDeviceCertificate(options)

Default options:

options = {
    thing_name = null,
    country_name = 'TW',
    state_name = 'Taipei',
    locality_name = 'Nangang',
    organization_name = 'SoftChef',
    organization_unit_name = 'IT'
}

You can customize the thing name, please ensure the thing name is given uniquely.

The naming rule is based on AWS IoT requirement: Must contain only alphanumeric characters and/or the following: -_:

If your thing_name is null, alternatively, the thing name will generate from the device certificate.

ThingRegistry.getThingName()

Get the thing name. Your customized name or from the device certificate.

ThingRegistry.getKeysPath()

Return the keys path, properties follow AWS IoT connection options.

ThingRegistry.setCertsPath(path)

Change the default certificate files directory.

ThingRegistry.setCACertificateName(name)

Change the default CA certificate file name.

ThingRegistry.setCAPrivateKeyName(name)

Change the default CA private key file name.

ThingRegistry.setRootCACertificateName(name)

Change the default RootCA certificate file name.

ThingRegistry.setDeviceCsrName(name)

Change the default device certificate request file name.

ThingRegistry.setDeviceCertificateName(name)

Change the default device certificate file name.

ThingRegistry.setDevicePublicKeyName(name)

Change the default device public key file name.

ThingRegistry.setDevicePrivateKeyName(name)

Change the default device private key file name.

License

This SDK is distributed under the GNU GENERAL PUBLIC LICENSE Version 3, see LICENSE for more information.

Support

If you have technical questions about sensor.live-things-registry, contact sensor.live support poke@sensor.live.

Keywords

FAQs

Package last updated on 24 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc