Loading

Limitations for Hiding the Salesforce Embedded Service Chat Component Based on Agent Availability

Дата публикации: Jun 11, 2026
Описание

In some implementations, there is a requirement for the Salesforce Embedded Service Chat component to show only when a service agent is online and to hide automatically when all agents are offline. However, Salesforce Embedded Service Chat is not designed with a built-in API to check agent availability in real time for the purpose of showing or hiding the chat widget. This article explains the current limitation and describes possible alternative approaches using JavaScript.

 

Решение

Current Limitation: No Agent Availability API for Embedded Service

There is currently no supported API in Salesforce Embedded Service Chat that checks whether a service agent is online or offline in real time. This is a key difference from the legacy Salesforce Live Agent (Classic Chat) implementation.

Comparison: Live Agent vs. Embedded Service

In the legacy Salesforce Live Agent (Classic Chat) implementation, you can wrap online and offline button elements in a div HTML element and pass the div ID to the showWhenOnline JavaScript method. This method controls the visibility of the div based on the real-time availability of agents. However, no equivalent method exists in the Salesforce Embedded Service Chat API for detecting agent status programmatically.

Possible Workaround Using JavaScript

One possible approach is to use the embedded_svc.settings.displayHelpButton setting to control the visibility of the Embedded Service Chat button. When this setting is true, the chat button is displayed. When it is false, the button is hidden. A custom JavaScript implementation could theoretically toggle this value based on external logic, but there is no native Salesforce API to provide real-time agent availability data to drive this logic.
For additional styling and behavioral customization of the Embedded Service Chat button, refer to the Customizable Parameters documentation linked in Additional Resources below.

embedded_svc.settings.displayHelpButton = true; //Or false

Important Disclaimer

The workarounds described in this article are possible approaches only and require additional review, custom development, and testing before they can be considered functional implementations. Salesforce Support is not able to provide or support a fully working custom solution based on these suggestions. These are directions for exploration, not supported configurations.

Номер статьи базы знаний

000383348

 
Загрузка
Salesforce Help | Article