Answered

Salesforce Community Lightning Component

  • 7 November 2023
  • 2 replies
  • 167 views

Badge

Hi Community,

Does anyone have experience with building Lightning Components for Intercom? We want to add a button to our Salesforce Community that says, “start a live chat” and when clicked, it uses the Intercom JS API to open the messenger - https://developers.intercom.com/installing-intercom/web/methods/

The challenge we’re having is we don’t know how to build a lightning component that will work in our Salesforce community that calls the Intercom JS API.

Best,

Kevin

icon

Best answer by Jacob Cox 12 November 2023, 23:40

View original

2 replies

Badge

@Eric Fitz did you do anything like this when you guys were using SFDC Communities? 

Userlevel 4
Badge +5

Hey there @Kevin D13 !

I, myself, have never attempted setting up something like this, but this is an old thread in our Forum that discusses integrating intercom into Salesforce Lightning! You can read up on that here.

Below is the actual instructions which I’m stealing from that link, above.

 

Setting up Intercom Messenger on Intercom Salesforce Community

Configure Intercom Messenger in Communities

To set up Intercom messengers in the communities, one possible solution we will be using is  Lightning Web Components (LWC) for the UI and Apex code on the server-side since lightning components are intended to modify their own scope (See Lightning Locker for a full explanation), to initialize the Intercom javascript we need to make use of Head Markup.

 

Configuring messenger in the community using LWC

 

  1. Create an LWC Project ‘intercom’, under which we will create LWC and server-side Apex code.
  2. On creating LWC, three files, intercom.html, intercom.js-meta.xml, and intercom.js, will be created under force-app/main/default/lwc

 

intercom.html

HHgDcfJ4dbqzcfnJSpbItnmciMvc2yX5qrCLLaMxxM8CsZ7ITmXUOgh84h98bi_tEfVQW5H1yPnvFZHqCnoyegUa1zDq68IFgpUvUv7BviL_Gzv4taofktuLvbgCxmSqIkt_JfV0sJjQeAjbXHFBT84

intercom.js-meta.xml

H7iiu1QUCzObC1AHeZ5feA2o6TUPltct0SZDzjPcy5-3Ibpo7d3VxqBjO0V4Z7N88_0reP6PyxP8Jtfx-vf9EJ6IbHL0ZuQKcbdYyfd___dmxxllHr_PeH_6qUVa2rDmDwCwhegqX9L-5wTgsdtV0oM

intercom.js

yBKksA4w51e_ENKX-1IUejyeZkAKlJCH3Ns6c4eTCENTBxKXkP_ueC62puMxR26nIOkGXCQpaAK8Db4nV4zICl4b_XjqWoL6wP7xxsGANg7qwkSD8BL09G3R457gEPi6nEPrPeY4mQ2h7zw4rIidTDY

Reply