ocilo / skype-http

Unofficial Skype API for Node.js via HTTP
https://ocilo.github.io/skype-http
MIT License
51 stars 24 forks source link

`api.getState` is not defined. #45

Closed darkyen closed 7 years ago

darkyen commented 7 years ago
function login(){
  const statePath = sysPath.resolve(__dirname, "api-state.json");
  try {
    const stateContent = fs.readFileSync(statePath).toString("utf8");
    const apiContext = JSON.parse(stateContent);
    return skypeHttp.connect({
      state: apiContext,
      verbose: false
    });

  } catch (err) {
    return promptCredentials()
      .then((credentials) => skypeHttp.connect({
        credentials: credentials,
        verbose: false
      }));
  }

}

If I use this then in the resultant api object getState is not defined.

mitchcapper commented 7 years ago

Very sorry that is a feature in master, we should be updating the npm package within the next few weeks once we finalize master. If you do want to use that feature currently you could use master.

darkyen commented 7 years ago

Didn't realize that, my other question was related to this. Is this safe to store this entire state in Keytar?

mitchcapper commented 7 years ago

Yes you can stringify the entire state no problem. Also you can reply on closed ticket (as the keytar is more related to the other) if desired. Sorry for the confusion on the API we are doing some rapid development currently and working to finalize the stability of state restore.