Newer Version Available

This content describes an older version of this product. View Latest

Automated Chat Invitation Code Sample

Test and preview how automated chat invitations can work on your website using this code sample.

The following code is for an automated chat invitation that uses the addButtonEventHandler() method to display a customized invitation on a website. This invitation allows customers to start a chat with an agent when an agent with the correct skills is available to chat.

If enhanced domains aren’t enabled in your org, your URL format is different. For details, see My Domain URL Formats in Salesforce Help.

Note

This code lets you pass data that’s available in JavaScript so it can be used in your invitation’s sending rules in Setup. This is an example of how your settings might look:
Automated invitation sending rules in Setup