Displaying chat only if there are agents available

Hi,

I understand that I can use business hours to define when agents are expected to be available and hide the web widget automatically when it’s outside business hours.

But is there a way to do this based on agents statuses? I would like to hide the widget if there are no agents online at this moment.

Automatically triggering offline experience should also work for our use-case.

Hi @fernandomm if you are using the embeded chat widget in you website you should be able to set the value of chat=false programitically to disable the chat widget altogether.

<script
src='//in.fw-cdn.com/30858991/454374.js'
chat='false'>
</script>

Something like

if time.now not in business_hours.time_range {
 scriptTag = document.querySelector('script');
scriptTag.setAttribute('chat', 'false');
}else {
scriptTag.setAttribute('chat', 'true');
}

Note: the above is a pseudocode