forcedotcom/sf-skills / plugins/builder/service-engagement/skills/service-digital-engagement-messaging-site-integrate
service-digital-engagement-messaging-site-integrate
VerifiedIntegrates 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 16.9 KB |
| references/aura_patch.md | markdown | 2.4 KB |
| references/bundle_detection.md | markdown | 2.5 KB |
| references/deploy_and_publish.md | markdown | 3.6 KB |
| references/lwr_patch.md | markdown | 3.7 KB |
| references/lwr_route_scaffolding.md | markdown | 1.8 KB |
| references/manual_fallback.md | markdown | 3.0 KB |
| scripts/detect_bundle_type.shexecutable | script | 1.1 KB |
| scripts/patch_aura_bundle.shexecutable | script | 4.1 KB |
| scripts/patch_lwr_bundle.shexecutable | script | 7.3 KB |
references/lwr_patch.md
View on GitHub# LWR — Patching themeLayout footer (site-wide widget placement)
Target files:
```text
digitalExperiences/site/<siteName>/sfdc_cms__themeLayout/*/content.json
```
The patch is applied by `scripts/patch_lwr_bundle.sh`. Invoke as:
```bash
scripts/patch_lwr_bundle.sh <site-dir> <deploymentName> <scrtUrl> <siteEndpoint>
```
where `<site-dir>` is the root of the retrieved bundle, e.g.:
`<retrieve-dir>/digitalExperiences/site/<siteName>`
Targeting the `sfdc_cms__themeLayout` footer (not `sfdc_cms__view/home/content.json`) places the widget as a site-wide floating overlay on every page — equivalent to the Aura `themeFooter` region placement.
## What the script does
1. Finds every `sfdc_cms__themeLayout/*/content.json` file under `<site-dir>`.
2. For each file, locates the `footer` region at `.contentBody.component.children[]` (where `.name == "footer"`).
3. Within that region, finds the existing `community_layout:section` wrapper (`.type == "component"`), then the inner slot region (`.type == "region"`) inside it — the inner region is where the widget goes (e.g. `footerSection`, `content`, etc.).
4. Recursively checks whether any descendant node already has `.definition == "experience_messaging:embeddedMessaging"`.
5. **If found** — updates that node's `.attributes` to the six standard values and **preserves the existing `.id`**:
- `deploymentName`, `scrtUrl`, `siteEndpoint` (from CLI args)
- `isExpSiteAuthMode: false`, `hideChatButtonOnLoad: "Default"`, `clientVersion: "WebV2"`
6. **If absent** — appends a fresh messaging component node directly into the inner region's `children[]`. The node has `"type": "component"` and `"definition": "experience_messaging:embeddedMessaging"`. No new `community_layout:section` wrapper is created — the section wrapper already exists in the footer region.
7. Handles the edge case where no wrapper section or inner region exists: falls back to appending directly to the footer's `children[]`.
8. Writes each file back with jq's 2-space indentation.
Re-running with the same arguments is a no-op (idempotent); re-running with new deployment coordinates refreshes the attributes in place without changing the component's `id`.
## How to verify
- Exactly one messaging node exists per themeLayout file:
```bash
jq '[.. | select(.definition? == "experience_messaging:embeddedMessaging")] | length' \
<site-dir>/sfdc_cms__themeLayout/<layoutName>/content.json
# → 1
```
- The node lives inside the footer region's subtree:
```bash
jq '
.contentBody.component.children[]
| select(.name? == "footer")
| [.. | select(.definition? == "experience_messaging:embeddedMessaging")]
| length
' <site-dir>/sfdc_cms__themeLayout/<layoutName>/content.json
# → 1
```
- `clientVersion` is `"WebV2"` (not `"WebV1"`):
```bash
jq '.. | select(.definition? == "experience_messaging:embeddedMessaging") | .attributes.clientVersion' \
<site-dir>/sfdc_cms__themeLayout/<layoutName>/content.json
# → "WebV2"
```
## Common failures
| Symptom | Cause |
|---------|-------|
| Widget only appears on the home page | Script was run against `sfdc_cms__view/home/content.json` instead of the themeLayout files |
| Widget appears on no pages after deploy | The footer region name differed from `"footer"` — inspect `.contentBody.component.children[].name` in the themeLayout |
| Two chat buttons after re-run | Detection did not descend into the full tree; the recursive `has_messaging` check avoids this |
| Deploy error "component not registered" | Used `componentName` (Aura shape) instead of `definition` (LWR shape) |
| `clientVersion: "WebV1"` — widget appears but Enhanced Web Chat fails | Script emitted `WebV1`; re-run the script (it defaults to `WebV2`) |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |