I'm following this documentation https://developer.tuya.com/en/docs/iot/device-control-best-practice-nodejs?id=Kaunfr776vomb
my code is as in the example:
const { TuyaContext } = require('@tuya/tuya-connector-nodejs')
const context = new TuyaContext({
baseUrl: 'https://openapi.tuyaus.com',
accessKey: 'hidden',
secretKey: 'hidden',
})
async function test () {
const device_id = 'hidden'
const devicedetail = await context.device.detail({
device_id: device_id,
})
if (! devicedetail.success) {
new Error()
}
console.log('Device details:', devicedetail)
}
test()
But I'm getting this error:
Device details: {
code: 60009001,
msg: 'API permission package error. For the solution, see https://developer.tuya.com/en/docs/iot/authentication-method?id=Ka49gbaxjygox.',
success: false,
t: 1719470515607,
tid: '585338b5345011ef9c7442b1fe1466b5'
}
There is no explanation how it should work
I'm following this documentation https://developer.tuya.com/en/docs/iot/device-control-best-practice-nodejs?id=Kaunfr776vomb
my code is as in the example:
But I'm getting this error:
There is no explanation how it should work