Get started With APIs for Enhanced Web Chat
To use the JavaScript APIs for Enhanced Web Chat, add the code snippet provided by Salesforce from your deployment settings to your web page. See Enhanced Web Chat Reference for more details on the APIs.
Here are the steps to configure your web page to use the Enhanced Web Chat APIs.
-
From Setup, in the Quick Find box, enter
Embedded Service Deployments
, and select Embedded Service Deployments. See Configure an Enhanced Web Chat Deployment in Salesforce Help. -
Click Code Snippet.
-
To retrieve the code snippet, follow the on-screen instructions.
-
Add the code snippet to your web page. Here’s an example of a code snippet.
-
Add the Enhanced Web Chat APIs to your web page. You can call the APIs inside or outside the code snippet, but call them after the client dispatches the
onEmbeddedMessagingReady
event. If you call the APIs before receiving this event, they don't execute.If your Enhanced Web Chat deployment is on an Experience Cloud site, follow the instructions in Salesforce Help to add JavaScript code to the head markup section of your site. See Configure an Enhanced Web Chat Deployment in an Experience Builder Site in Salesforce Help.
-
To ensure that Enhanced Web Chat works optimally, always republish your deployment after testing newly added features and bug fixes. See Configure an Enhanced Web Chat Deployment in Salesforce Help.