Closed bradennapier closed 7 years ago
Currently I'd say just do a setTimeout or setInterval to proactively refresh the token, although I'm still looking into what would be an ideal solution.
BTW, this is what the official demo app does now: https://github.com/watson-developer-cloud/speech-to-text-nodejs/blob/master/views/demo.jsx#L228 and it seems to be working pretty well. So I think that's the recommend solution for now.
So we will need to fetch a new token after a hour it would appear. What is the recommended method of discovering that a new token is needed from the server so the request can be made? It does say a hour but that current sessions are not affected so it may not even matter (I am returning a ttsToken when session starts)