Loading...
Loading...
Integrates a Messaging for In-App and Web (MIAW) Embedded Messaging chat widget into an Experience Cloud site by patching the site's LWR or Aura page bundle, deploying, publishing, and verifying guest access. Use when the user wants to embed messaging on an Experience site, add a chat widget to a community, place the Embedded Messaging component on an LWR or Aura page, wire an embedded service deployment to a site, references the retrieved bundle artifacts (`content.json`, `homeGuestLayout.json`, or a `*.site-meta.xml` file), or automates the retrieve/patch-JSON/deploy/publish flow instead of clicking through Experience Builder. DO NOT TRIGGER when creating the messaging channel (use service-digital-engagement-channel-configure), when creating or updating the EmbeddedServiceConfig deployment (use service-digital-engagement-deployment-configure), or when generating a standalone JavaScript snippet for a non-Experience website.
npx skill4agent add forcedotcom/sf-skills service-digital-engagement-messaging-site-integrateDigitalExperienceBundleExperienceBundleexperience_messaging:embeddedMessagingidtoo-many-requestsforce-appNetwork.NameEmbeddedServiceConfigservice-digital-engagement-deployment-configureMessagingChannelservice-digital-engagement-channel-configureexperience-lwr-site-generateDeveloperNamedigitalExperiences/site/<siteName>/experiences/<siteName>/deploymentNameDeveloperNamescrtUrlsiteEndpointEmbeddedServiceConfigservice-digital-engagement-deployment-configuresfUrlPathPrefixNetwork.NameDeveloperNameDeveloperNameEmbeddedServiceConfigesw-siteisExpSiteAuthModefalsehideChatButtonOnLoad"Default"clientVersion"WebV1"200<retrieve-dir>sf project retrieve start --metadata "DigitalExperienceBundle:site/<siteName>" \
--target-org <org-alias> --target-metadata-dir <retrieve-dir>
sf project retrieve start --metadata "ExperienceBundle:<siteName>" \
--target-org <org-alias> --target-metadata-dir <retrieve-dir>scripts/detect_bundle_type.sh <retrieve-dir> <siteName>LWRdigitalExperiences/site/<siteName>/sfdc_cms__view/home/content.jsonAURAexperiences/<siteName>/views/homeGuestLayout.jsonUNKNOWNreferences/bundle_detection.mdtoo-many-requestsexperience-lwr-site-generateconfigure-content-route.mdconfigure-content-view.mdhandle-component-and-region-ids.mdreferences/lwr_route_scaffolding.mdscripts/patch_lwr_bundle.sh \
<retrieve-dir>/digitalExperiences/site/<siteName>/sfdc_cms__view/home/content.json \
<deploymentName> <scrtUrl> <siteEndpoint>.contentBody.component.children[].type == "region".name == "content".definition == "experience_messaging:embeddedMessaging"idcommunity_layout:sectionsectionConfigreferences/lwr_patch.mdscripts/patch_aura_bundle.sh \
<retrieve-dir>/experiences/<siteName>/views/homeGuestLayout.json \
<deploymentName> <scrtUrl> <siteEndpoint>.regions[].components[]forceCommunity:section.componentName == "experience_messaging:embeddedMessaging"idforceCommunity:sectioncomponentNamecomponentAttributesdefinitionattributesdxpStylereferences/aura_patch.mdcp -Rcp -R <retrieve-dir>/digitalExperiences force-app/main/default/cp -R <retrieve-dir>/experiences force-app/main/default/<siteName>.site-meta.xmlsf project deploy start --source-dir force-app/main/default \
--target-org <org-alias> --asyncsf project deploy report --job-id <job-id> --target-org <org-alias>SucceededFailedSucceededPartialCanceledreferences/deploy_and_publish.mdNetwork.NameNetwork.NameDeveloperNamesf data query --query \
"SELECT Name FROM Network WHERE UrlPathPrefix='<urlPath>' LIMIT 1" \
--target-org <org-alias>sf community publish --name "<resolved-Name>" --target-org <org-alias>curl -sL -o /dev/null -w "%{http_code}" \
https://<domainHostname>/<urlPath>200200references/manual_fallback.mdhttps://<MyDomain>.lightning.force.com/sfsites/picasso/core/config/commeditor.apexp?...networkId=<Network.Id><MyDomain>sf org display --target-org <org-alias><Network.Id>sf data query --query \
"SELECT Id FROM Network WHERE UrlPathPrefix='<urlPath>' LIMIT 1" \
--target-org <org-alias>| Constraint | Rationale |
|---|---|
| Detect bundle type from retrieval output, do not assume | LWR and Aura sites need different files patched with different key names |
Preserve the existing component | Ensures idempotency; the Experience runtime keys off |
Every new | Duplicate IDs corrupt the layout and can fail render |
LWR uses | Wrong key names silently drop the component from render |
LWR | The Experience CMS serializer expects a string |
Aura sibling | Deploy is rejected without it |
| Poll the async deploy; do not fire-and-forget | Publish must run only after deploy succeeds |
Resolve | The two are frequently different |
Do not claim "live on the site" until the guest URL returns | Publish is asynchronous; premature success reports mislead |
Never hardcode | Values are org-specific and must be queried |
| Idempotency: re-running with new ESD coordinates must update in place | Users iterate on |
| Issue | Resolution |
|---|---|
| Scaffold the missing route+view pair per |
| Aura deploy rejected with missing site metadata | Copy the sibling |
| Component appended but not rendering | Confirm the region wrapper uses the correct |
| The |
Guest URL returns | Publish is async — retry the smoke test after 60s before falling back to manual |
| Re-run adds a second messaging component | The recursive search matched on the wrong key name; component detection must use |
| Deploy succeeds but widget does not appear | The messaging component is present in a region that is not on the site's home page — patch |
| Serialize it as a JSON string; the CMS parser will not accept an object |
sfdc_cms__view/home/content.jsonviews/homeGuestLayout.jsondefinitionattributescomponentNamecomponentAttributesididsectionConfigsectionConfigidid<siteName>.site-meta.xmlSucceededSucceededPartialNetwork.NameUrlPathPrefixDeveloperNamesf community publish200200force-app/main/default/...sfdc_cms__route/<RouteApiName>/sfdc_cms__view/<viewId>/job-idEmbeddedServiceConfigMessagingChannel| Need | Delegate to |
|---|---|
| Create or update the Embedded Service Deployment | |
| Create the underlying MIAW messaging channel | |
| Create the Experience Cloud LWR site itself | |
Scaffold a missing LWR route + view pair (e.g. | |
| File | When to read |
|---|---|
| Phase 1 — LWR vs Aura retrieval and disambiguation |
| Phase 2 — delegation pointer for scaffolding missing LWR template routes (owned by |
| Phase 2 — what |
| Phase 3 — what |
| Phases 4–5 — staging into |
| Phase 6 — Experience Builder deep link and manual drag-drop-publish instructions |
| Phase 1 — deterministic LWR/Aura/UNKNOWN detection over a retrieved bundle |
| Phase 2 — idempotent LWR |
| Phase 3 — idempotent Aura |