🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@deepcodestudio/ctwing-sdk-browserify

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deepcodestudio/ctwing-sdk-browserify

Offer ctwing sdk for browser or react-native enviorment

1.0.0
latest
Source
npm
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

Purpose

Offer ctwing sdk for browser or react-native enviorment

inspired by ctwing-sdk but change the crypto library and query-params libarary implementation .

Installation

yarn add ctwing-sdk-browserify

Usage

import {CommandOperate, injectCTWingConfiguration} from '@deepcode/ctwing-sdk-browserify';
//you need inject your appKey and appSecret first ( create an application in ctwing platform and you will find them)
injectCTWingConfiguration(appKey, appSecret);
let commandOperate = new CommandOperate(productId, masterKey, deviceId);
//you always need to send json data , and different protocol(mqtt or t-link) have different message format
//following is mqtt message format
const mqttMessage = {
    payload: {
        status: 1,
        temperature: 26,
    },
}
//dispatch message to device
await commandOperate.sendJSON(mqttMessage);

Limitation

For these sdk implementation , I only use dispatch device command functionality , so that I can't ensure other functionality of this library work correctly .

But you also can modify it by your self , I already split the code to multiple file so that the code should be read easily .

In the end , Welcome PR to perfect this library .

Keywords

ctwing

FAQs

Package last updated on 07 Dec 2021

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