Skip to content
/ cloud Public
forked from TuyaAPI/cloud

๐ŸŒจ ๐ŸŽ A NodeJS wrapper for Tuya's cloud API. Documentation: https://tuyaapi.github.io/cloud/.

License

Notifications You must be signed in to change notification settings

nalajcie/cloud

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

49 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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.

Step-by-step instructions for acquiring API keys can be found here.

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: '[email protected]', 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

About

๐ŸŒจ ๐ŸŽ A NodeJS wrapper for Tuya's cloud API. Documentation: https://tuyaapi.github.io/cloud/.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%