Lightning Web Component Events for Enhanced Messaging

JavaScript can be executed when certain types of events occur in a console, such as when a user closes a tab. A few events are specific to Messaging. These events apply to Lightning web components in Lightning Experience only.

Use only rendered components with the Conversation Toolkit APIs. If you use a component that doesn’t have markup or that operates in the background, the APIs don’t work. The conversation component must also be rendered for the APIs to work.

Note

  • lightning__conversationAgentSend

    Messaging event triggered when an agent sends a message through the Salesforce console. This method intercepts the message before it’s sent to the chat visitor. This event is also triggered when using Enhanced Messaging channels. To work with Enhanced Messaging channels, the session must be active and the Enhanced Conversation Component must be visible on the page.

  • lightning__conversationEnded

    Messaging event triggered when an active chat ends or an agent leaves a chat conference. This event is also triggered when using Enhanced Messaging channels. To work with Enhanced Messaging channels, the session must be active and the Enhanced Conversation Component must be visible on the page.

  • lightning__conversationEndUserMessage

    Messaging event triggered when the customer sends a new message. In Enhanced Messaging channels, this event is triggered only for text messages. This event is not triggered for messages with files or rich content. To work with Enhanced Messaging channels, the session must be active and the Enhanced Conversation Component must be visible on the page.