skydiver / ewelink-api

eWeLink API for JavaScript
https://www.npmjs.com/package/ewelink-api
MIT License
264 stars 108 forks source link

APP SECRET #127

Closed undjike closed 3 years ago

undjike commented 3 years ago

How do I get my APP_SECRET ?

I'm using a non-SONNOFF device and it doesn't appear with getDevices method. I read other issues about this and a fix was to add the APP_ID and the APP_SECRET when intanciating the Ewelink connection. But, I don't know where to find my APP_SECRET. I got the APP_ID executing getCredentials method but no APP_SECRET.

inayatu commented 3 years ago

By creating new instance of ewelink like this you can have all your required fields necessary to perform other API calls.

const sonoff = new ewelink({ email: conf.email, password: conf.password, region: conf.region, });

you will get: { apiKey:null APP_ID:'xxxxxxx' APP_SECRET:'xxxxxxxx' arpTable:null at:null devicesCache:null email:xxxxxx@gmail.com' password:'xxxx@pass' phoneNumber:null region:'as' }

undjike commented 3 years ago

Okay, thanks. Got it. Just by console logging the instanciation.