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

@tuyapi/cloud

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tuyapi/cloud

A NodeJS wrapper for Tuya's cloud API

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

tuyapi/cloud Build Status Coverage Status XO code style

A NodeJS wrapper for Tuya's API.

At the moment, only the mobile/app API is supported as it covers the vast majority of use cases.

Installation

npm i @tuyapi/cloud

Usage

const Cloud = require('@tuyapi/cloud');

let api = new Cloud({key: 'your-api-app-key', secret: 'your-api-app-secret'});

api.register({email: 'example@example.com', password: 'example-password'}).then(async sid => {
  let token = await api.request({action: 'tuya.m.device.token.create', data: {'timeZone': '-05:00'}});

  console.log(token) // => { secret: '0000', token: '01010101' }
});

Documentation

Development

  1. After cloning, run npm i.
  2. Add a file called keys.json with the contents
{
  "key": "your-api-key",
  "secret": "your-api-secret"
}
  1. Create a file called dev.js as a playground. Since dev.js is in .gitignore, it won't be committed.
  2. To run tests, run npm test.
  3. To output coverage, run npm run cover (it will exit with an error).
  4. To build documentation, run npm run document.

forthebadge

Keywords

FAQs

Package last updated on 01 Aug 2018

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