Skip to content

forcedotcom/sf-skills / plugins/builder/service-engagement/skills/service-digital-engagement-messaging-site-integrate

service-digital-engagement-messaging-site-integrate

Verified

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.

FileKindSize
SKILL.mdskill md16.9 KB
references/aura_patch.mdmarkdown2.4 KB
references/bundle_detection.mdmarkdown2.5 KB
references/deploy_and_publish.mdmarkdown3.6 KB
references/lwr_patch.mdmarkdown3.7 KB
references/lwr_route_scaffolding.mdmarkdown1.8 KB
references/manual_fallback.mdmarkdown3.0 KB
scripts/detect_bundle_type.shexecutablescript1.1 KB
scripts/patch_aura_bundle.shexecutablescript4.1 KB
scripts/patch_lwr_bundle.shexecutablescript7.3 KB

scripts/patch_aura_bundle.sh

View on GitHub
#!/usr/bin/env bash
# patch_aura_bundle.sh
# Idempotently inserts (or updates in place) the
# experience_messaging:embeddedMessaging component inside an Aura site's
# homeGuestLayout.json.
#
# Locates the first .regions[] entry whose .components[] is non-empty and either
# refreshes the existing messaging component's .componentAttributes (preserving
# its .id) or appends a new forceCommunity:section wrapper containing the
# messaging component. Recursion descends into forceCommunity:section wrappers'
# nested .componentAttributes.regions[].components[].
#
# Usage:
#   patch_aura_bundle.sh <homeGuestLayout.json> <deploymentName> <scrtUrl> <siteEndpoint>
#
# Requires: jq, uuidgen (or /proc/sys/kernel/random/uuid, or python3).

set -euo pipefail

if [ "$#" -ne 4 ]; then
    echo "Usage: $0 <homeGuestLayout.json> <deploymentName> <scrtUrl> <siteEndpoint>" >&2
    exit 1
fi

LAYOUT_JSON="$1"
DEPLOYMENT_NAME="$2"
SCRT_URL="$3"
SITE_ENDPOINT="$4"

if [ ! -f "$LAYOUT_JSON" ]; then
    echo "Error: file not found: $LAYOUT_JSON" >&2
    exit 1
fi

if ! command -v jq >/dev/null 2>&1; then
    echo "Error: jq is required" >&2
    exit 1
fi

gen_uuid() {
    if command -v uuidgen >/dev/null 2>&1; then
        uuidgen | tr '[:upper:]' '[:lower:]'
    elif [ -r /proc/sys/kernel/random/uuid ]; then
        cat /proc/sys/kernel/random/uuid
    else
        python3 -c 'import uuid; print(uuid.uuid4())'
    fi
}

UUID_SECTION="$(gen_uuid)"
UUID_REGION="$(gen_uuid)"
UUID_MESSAGING="$(gen_uuid)"

TMP_OUT="$(mktemp)"
trap 'rm -f "$TMP_OUT"' EXIT

jq \
    --arg deploymentName "$DEPLOYMENT_NAME" \
    --arg scrtUrl "$SCRT_URL" \
    --arg siteEndpoint "$SITE_ENDPOINT" \
    --arg uuidSection "$UUID_SECTION" \
    --arg uuidRegion "$UUID_REGION" \
    --arg uuidMessaging "$UUID_MESSAGING" \
    '
    def attrs:
        {
            deploymentName: $deploymentName,
            scrtUrl: $scrtUrl,
            siteEndpoint: $siteEndpoint,
            isExpSiteAuthMode: false,
            hideChatButtonOnLoad: "Default",
            clientVersion: "WebV1"
        };

    def has_messaging(components):
        (components // []) | any(
            (.componentName? == "experience_messaging:embeddedMessaging") or
            (any((.componentAttributes.regions // [])[]?; has_messaging(.components // [])))
        );

    def update_messaging(components):
        (components // []) | map(
            if .componentName? == "experience_messaging:embeddedMessaging" then
                .componentAttributes = attrs
            elif ((.componentAttributes.regions // []) | length) > 0 then
                .componentAttributes.regions |= map(
                    .components = update_messaging(.components)
                )
            else . end
        );

    def new_section:
        {
            id: $uuidSection,
            componentName: "forceCommunity:section",
            componentAttributes: {
                regions: [
                    {
                        id: $uuidRegion,
                        type: "region",
                        regionLabel: "Column",
                        regionName: "column",
                        renditionMap: {},
                        components: [
                            {
                                id: $uuidMessaging,
                                componentName: "experience_messaging:embeddedMessaging",
                                componentAttributes: attrs
                            }
                        ]
                    }
                ]
            }
        };

    # Find index of first region whose .components[] is non-empty.
    (.regions // []) as $regions
    | ($regions | to_entries | map(select((.value.components // []) | length > 0)) | .[0].key) as $idx
    | if $idx == null then
          .
      else
          .regions[$idx] |= (
              if has_messaging(.components // []) then
                  .components = update_messaging(.components)
              else
                  .components = ((.components // []) + [new_section])
              end
          )
      end
    ' "$LAYOUT_JSON" > "$TMP_OUT"

mv "$TMP_OUT" "$LAYOUT_JSON"
trap - EXIT

echo "Patched: $LAYOUT_JSON"
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 119kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall