Get Deployment Configuration Details in Custom Lightning Web Components

Use code snippets to get Enhanced Web Chat deployment details in your custom Lightning web components.

language 

To get the language code for your client, use the following snippet in your custom component.

Example 

1const language = this.configuration.language;

termsAndConditions 

To get the Terms and Conditions settings for your client, use the following snippet in your custom component.

Example 

1if (this.configuration.termsAndConditions.isTermsAndConditionsEnabled) {
2  const isTermsAndConditionsRequired = this.configuration.termsAndConditions
3    .isTermsAndConditionsRequired;
4  const termsAndConditionsLabel = this.configuration.termsAndConditions.label;
5}

customLabels 

To get the customized labels in Embedded Service deployment setup in the language configured on the client, use the following snippet in your custom component. This example shows how to get the customized label for End Conversation Header text.

Example 

1const endConversationLabelObj =
2  this.configuration.customLabels.filter(
3    (label) =>
4      label.sectionName === "EmbeddedMessagingChatHeader" &&
5      label.labelName === "CloseConversation",
6  )[0] || {};
7const endConversationLabel = endConversationLabelObj.labelValue || "End Conversation";