removeContextProvider

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.

Removes the currently set custom context provider, if any.

Note

The live chat SDK 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.removeContextProvider();

Parameters

None

Return value

None

Example

window.addEventListener("lcw:ready", function handleLivechatReadyEvent(){
   // Set the custom context provider
   // Throws error if contextProvider is not a function
   Microsoft.Omnichannel.LiveChatWidget.SDK.setContextProvider(function contextProvider(){
      // Here it is assumed that the corresponding work stream would have context variables with logical name of 'contextKey1', 'contextKey2', 'contextKey3'.
      return {
                 'contextKey1': 'contextValue1', // string value
                 'contextKey2': 12.34, // number value
                 'contextKey3': true // boolean value
      };
   });

   // Removes the currently set custom context provider, if any
   Microsoft.Omnichannel.LiveChatWidget.SDK.removeContextProvider();
});

See also

JavaScript API reference for live chat SDK