Exchange Data Between Salesforce and Embedded MFE Widgets (Developer Preview)

Give embedded widgets real-time access to record context and org data, and receive user-interaction events back, without custom integration code or managing authentication tokens.

Where: This change applies to Lightning Experience, Experience Builder sites, and Experience Cloud LWR sites in all editions.

Note
Note The Dev Channel provides access to features that are not generally available and have been designated as pilot, beta, limited release, or developer preview. Their use is at the Customer's sole discretion and is subject to the Beta Services Terms at Agreements - Salesforce.com.

How: Push data from the host to the widget:

  • In your wrapper LWC, call shell.updateData({ recordId, locale }). Payloads sent before the iframe handshake completes are queued and delivered automatically. Payloads are sent via postMessage which internally uses structuredClone, so objects like DOM Elements and Functions aren't allowed.
  • Payloads must be JSON-serializable. Non-JSON types like Date, Map, Set, and Blob aren't supported. For example, Date objects are converted to ISO strings. Functions, DOM nodes, and class instances are dropped. For complex values, use JSON.stringify() before passing and parse them on the widget side.

Receive events from the widget:

  • Listen on the shell element: shell.addEventListener('event-name', handler). The MFE Bridge re-fires widget events as CustomEvents on the host element.
  • Event names on the shell are kebab-case (for example, dealer-selected). Because LWC templates reject hyphens in on… handler names, subscribe via addEventListener — not template event bindings.