I dont see in the documentation anywhere the ability to hide the chat.
https://www.twilio.com/docs/flex/flex-webchat-basic-configuration
Essentially, I want the chat to NOT show on a website if no agents are available. Is this possible?
I dont see in the documentation anywhere the ability to hide the chat.
https://www.twilio.com/docs/flex/flex-webchat-basic-configuration
Essentially, I want the chat to NOT show on a website if no agents are available. Is this possible?
It looks like I have to call twilio flex to get avaialble workers, and set this property accordingly.
const defaultConfiguration: Config = {
...
available: {BoolValueDependingOnAgentAvail},
Here is an example of javascript that leverages the necessary API to obtain the worker count. Based on this variable, you can set the BoolValueDependingOnAgentAvail accordingly
client.taskrouter
.workspaces('WSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
.workers.list()
.then(workers => {
data = {
availWorkersCount: Object.keys(workers.filter(x=> x.available === true && x.attributes.includes("sales"))).length
};