closeChat

Omnichannel for Customer Service offers a suite of capabilities that extend the power of Dynamics 365 Customer Service Enterprise to enable organizations to instantly connect and engage with their customers across digital messaging channels. An additional license is required to access Omnichannel for Customer Service. For more information, see the Dynamics 365 Customer Service pricing overview and Dynamics 365 Customer Service pricing plan pages.

Ends the conversation between the agent and customer. Any browser cache related to the conversation is also deleted.

Note

Listen for the lcw:ready event raised by a live chat before calling the live chat SDK methods. The live chat methods should be invoked after the lcw:ready event is raised. You can listen for this event by adding your own event listener on the window object.

Syntax

Microsoft.Omnichannel.LiveChatWidget.SDK.closeChat();

Parameters

None

Return Value

None

Example

window.addEventListener("lcw:ready", function handleLivechatReadyEvent(){
               // Closes an existing chat
               Microsoft.Omnichannel.LiveChatWidget.SDK.closeChat();
});

startChat
setContextProvider
Live chat SDK JavaScript API reference