Rocket.Chat.js.SDK icon indicating copy to clipboard operation
Rocket.Chat.js.SDK copied to clipboard

Use SDK with personal access token

Open eloo opened this issue 4 years ago • 2 comments

Hi,

i'm trying to get the sdk running with personal access token but it seems not to work. Is this a bug? Or should it be just not be possible to use the access token for the real-time api? At least this seems not be document anywhere

Thanks

eloo avatar Feb 23 '22 09:02 eloo

At least in the Golang SDK i found an option to use the userId and token directy. Seems like this is missing here?

eloo avatar Feb 23 '22 11:02 eloo

Hi @eloo It's weird and just workaround but you can use setAuth from api file after that call get/post functions to check your token. I've tested this approach and it works. https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/master/src/lib/api.ts#L57

serjk avatar Apr 06 '22 10:04 serjk