@lightning-out/lwc-shell
v2.2.0
Published
A standard Web Component shell for UI Embedding
Keywords
Readme
@lightning-out/lwc-shell
A custom web component (<lwc-shell>) that renders a sandboxed <iframe> to embed Micro-Frontend (MFE) applications inside Salesforce Lightning pages, Experience sites, and other LWC-enabled surfaces.
Key Capabilities
- Sandboxed
<iframe>rendering inside a closed Shadow DOM - Cross-origin communication with embedded MFE apps via
postMessagebridge - Configurable sandbox tokens, fullscreen mode, automatic resize, and theme forwarding
- Dirty-state tracking via
trackdirtystateevent - Framework-agnostic — extends
HTMLElementdirectly
Documentation
| Document | Description |
|---|---|
| Web Component API | Full specification of the <lwc-shell> web component — attributes, properties, methods, events, and sandbox security. |
| LWC Wrapper Guide | Step-by-step guide to writing an LWC wrapper, from setup and vendor build through to deployment, with a complete code recipe. |
| Dirty State Flow | How MFE widgets track unsaved changes via trackdirtystate and how the shell relays it to the host platform. |
| PostMessage Security | Security model for postMessage communication between the shell and the embedded iframe. |
Package Contents
| Path | Purpose |
|---|---|
| src/InternalHostLwcShell.ts | Core web component implementation (<lwc-shell> custom element). |
| scripts/vendor-build.mjs | CLI tool (lwc-shell-vendor-build) that copies the built ESM bundle as a vendor-prefixed LWC component. |
