---
schema_version: "1"
id: 7c0b92ab0ba672ca536d04b72bb3b3f417ae1cb2816fa79a8580f8994be6d6c8
title: Embedded Messaging Set Up
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/es_embedded_messaging_set_up.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.es_embedded_messaging_set_up.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: bfae0fb64c4e318e5706ff14be586b720f1197ae0e89658ab0a17dba75734f12
description: Configure Embedded Messaging in the Employee Portal site to help your employees get instant help and case statuses by chatting with a bot or a service representative.
products:
  - Service Cloud
release: "264"
---
# Embedded Messaging Set Up

Configure Embedded Messaging in the Employee Portal site to help your employees get instant help and case statuses by chatting with a bot or a service representative.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.service_editions_reference.htm&amp;language=en_US" target="_blank">View supported editions</a>.</td></tr></tbody></table>

To set up Embedded Messaging, perform these tasks:

- Prepare a Salesforce org.
- Configure a deployment.
- Optionally, set up a pre-chat form.
- Add the Embedded Messaging component to the Employee Portal site.
- Configure the component.
- Add your domain to the Cross-Origin Resource Sharing (CORS) allowlist.

See [Embedded Messaging](https://help.salesforce.com/s/articleView?id=experience.rss_embedded_messaging.htm&type=5&language=en_US).

During the setup, when you configure a web deployment, add a similar JavaScript code within a <script> tag to use Pre-Chat API to pass an employee's user ID to the Omni-Channel flow. See [Configure an Enhanced Web Chat Deployment in an Experience Builder or Commerce Cloud site](https://help.salesforce.com/s/articleView?id=service.miaw_deployment_experience_builder.htm&type=5&language=en_US).

`<script>     window.addEventListener("onEmbeddedMessagingReady", e => {         const userId = $A.get("$SObjectType.CurrentUser.Id");         console.log("User id is:"+userId);         embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields({             "userId": userId});     }); </script>`

The Omni-Channel flow retrieves the employee's account ID, contact ID, and full name and updates the messaging session record with these details. With the updated messaging session record, service representatives see the employee's name in every incoming chat message notification.

To hide the pre-chat form from the employee, add the User ID field as a hidden pre-chat field. See [Customize Pre-Chat for Messaging for In-App and Web](https://help.salesforce.com/s/articleView?id=service.miaw_custom_prechat_3.htm&language=en_US).

- **[Update Messaging Session with Employee Details](https://help.salesforce.com/s/articleView?id=service.es_update_messaging_session_with_contact_details.htm&release=264.0.0&type=5)**  
    When an employee contacts a service representative through chat, the service representative receives an incoming chat notification in HR Service Console. To show the name of the employee in the notification, the messaging session record must contain the employee's account ID, contact ID, and full name. To update the messaging session record with these details, create an autolaunched flow and update the Omni-Channel flow.
- **[Set Up Case Management Bot](https://help.salesforce.com/s/articleView?id=service.es_case_management_bot_set_up.htm&release=264.0.0&type=5)**  
    Configure Embedded Messaging with a case management bot. With the bot, your employees can create cases and find case statuses rapidly.