Logged in Twilio Flex User SID

385 Views Asked by At

I am new to twilio and trying to develop a plugin that shows a dashboard with some data of the agent(who is logged in). Can anyone please let me know how do I get the SID of the current user in twilio?

2

There are 2 best solutions below

0
On BEST ANSWER

Twilio developer evangelist here.

The Flex Manager object has a workerClient property which gives you access to a Twilio.TaskRouter.Worker object, which is the logged in worker. That worker object has a sid property.

0
On

Give this a shot:

const manager = flex.Manager.getInstance();
const accountSid = manager.workerClient.accountSid;
console.log(accountSid); // ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx