You can plug Einstein Bots into any website or mobile app so why not start with an Einstein Bot for your Salesforce Lightning users? Salesforce Chat makes this process really simple if you’re looking for a low-code solution, which I’ll focus on for this article.
Before we get started be sure you have already finished creating at least a simple Einstein Bot configured for Chat. You will need a working Einstein Bot and Chat channel in order to complete the following steps. If you haven’t done that before, the Build an Einstein Bot project is a great place to start.
To start, you’ll need to collect some details about your Salesforce Chat configuration that we’ll use to set things up.
Navigate to your Chat Button in Lightning Setup and copy the auto-generated code snippet at the bottom. Take note of the unique Id assigned to your button in the code. I’ve added
an arrow to the screenshot below to help you find it.
Next, take a look at your Chat Deployment setup and grab the auto-generated code snippet at the bottom.
Navigate to the Pages node in Lightning Setup and create a new Visualforce Page.
Delete everything between the <apex:page> and </apex:page> tags and replace with your Chat Button code Like this:
Paste in your Chat Deployment code next like this:
Insert the following Button Event Handler code immediately before the liveagent.init statement and add your unique button Id in the two places indicated. This little snippet will tell the bot to start chatting right away without extra clicks.
Before you click save, make this page Available for Lightning Experience.
Ok, that’s all the coding we have to do. Not bad.
Navigate to App Manager in Lightning Setup and edit your Lightning App. In this example, I’m using the Service Console, but any Lightning App should work.
Select the Utility Items tab and click on the Add Utility Items button to add a Visualforce component.
Configure your Visualforce Utility Item as follows, making sure to select the Visualforce Page we created in step 2.