When you add a custom Lightning web component to your embedded service deployment, it runs as an unauthenticated guest user in the chat window, even when a user is logged in to your Experience Cloud site. To run the component as a logged-in site user instead, add the user's profile or permission set to the Embedded Service site's member list. Running the component as the logged-in user gives the custom component access to read and act on the user's data.
Required Editions
| View supported editions. | |
This article applies to:
|
Enhanced Web Chat channels |
This article doesn’t apply to:
|
Enhanced In-App Chat, Enhanced WhatsApp, Enhanced Facebook Messenger, Standard and Enhanced SMS, Enhanced Apple Messages for Business, Enhanced LINE, and Bring Your Own Channel |
| User Permissions | |
|---|---|
| To set up this feature: |
Customize Application AND Modify Metadata Through Metadata API Functions |
| To modify permission sets and profiles: | Manage Profiles and Permission Sets |
| To add the Embedded Messaging component to an Experience Builder site: | Create and Setup Experiences |
Before you begin:
- Add your custom component to your embedded service deployment.
- Make sure that the Experience Cloud site and Embedded Service site use the same domain.
- Set up credential-based user verification for your Enhanced Web Chat deployment.
-
Identify the profiles and permission sets that you want to give the custom component access
to.
- From Setup, in the Quick Find box, enter All Sites, and then select All Sites.
- Next to your Experience Cloud site, select Workspaces.
- Click Administration and then select the Members tab.
- Review the selected profiles and permission sets and determine which ones you want to add to the Embedded Service site's member list.
-
Add the profiles and permission sets that you identified earlier as Embedded Service site
members. By default, the Salesforce admin profile is a member of the Embedded Service
site.
-
On the All Sites Setup page, select Workspaces next to your
Embedded Service site. Embedded Service site names start with
ESW. - Click Administration and then select the Members tab.
- Select the profiles and permission sets.
- Save your changes.
-
On the All Sites Setup page, select Workspaces next to your
Embedded Service site. Embedded Service site names start with
- To confirm that the custom component runs as the logged-in user, open your Experience Cloud site and log in as a user whose profile you added. Then open the chat window and confirm that the custom component shows the logged-in user's data instead of the guest user's data. Repeat the test as a user whose profile and permission sets you didn't add.
To stop the component from running as a logged-in user, remove that user's profile or permission set from the Embedded Service site's member list.
See Also
- Personalize the Enhanced Chat v2 UI with Custom Lightning Types
- Configure an Enhanced Web Chat Deployment in an Experience Builder or Commerce Cloud Site
- Persist Secure Messaging History Across Multiple Devices with User Verification
- Set Security Protocols for Your Messaging for Web Deployment
- Manage Site Membership

