TuyaCloud

A TuyaCloud object. Providing apiEtVersion option means that the new sign mechanism (HMAC-SHA256) instead of old (MD5) will be used. This also makes secret2 and certSign mandatory.

new TuyaCloud(options: Object)
Parameters
options (Object) construction options
Name Description
options.key String API key
options.secret String API secret
options.apiEtVersion String? Tag existing in new mobile api version (as const '0.0.1'),
options.secret2 String? Second API secret token, stored in BMP file (mandatory if apiEtVersion is specified)
options.certSign String? App certificate SHA256 (mandatory if apiEtVersion is specified)
options.region String (default 'AZ') region (AZ=Americas, AY=Asia, EU=Europe)
options.deviceID String? ID of device calling API (defaults to a random value)
Example

Using the MD5 signing mechanism:

const api = new Cloud({key: 'your-api-key', secret: 'your-api-secret'})

Using the HMAC-SHA256 signing mechanism:

const api = new Cloud({key: 'your-api-key', secret: 'your-api-secret',
                       apiEtVersion: '0.0.1', secret2: 'your-apm-secret2',
                       certSign: 'your-api-cert-sign'})
Instance Members
request(options)
register(options)
login(options)
loginEx(options)
waitForToken(options)