Embed Lightning Out 2.0 components on external pages using Experience Cloud Lightning Web Runtime (LWR) sites. Lightning Out 2.0 now supports Experience Sites (CLWR) for both guest (unauthenticated) and registered (authenticated) user scenarios. Guest user access is available for the Build Your Own (LWR) and Lightning Out templates in Experience Cloud sites. Use an existing CLWR site or create a new one, associate it with your Lightning Out 2.0 app, and publish, then embed your components on any external page.
Where: This change applies to Lightning Experience and Experience Builder in Enterprise, Performance, Unlimited, and Developer editions with Experience Cloud LWR and Lightning Out 2.0 licenses.
Who: Administrators configure the Experience Cloud site, guest user access, trusted domains, CSP and frame settings, and Lightning Out deployment in Setup. Developers install the embed snippet on the external host page.
Why: Experience Sites support brings Lightning Out 2.0 to both public-facing and authenticated scenarios. Guest access enables embedding without requiring users to sign in, while authenticated access gives registered community members personalized, permission-aware components on external websites with session management scoped to their site context.
How: Set up your Experience Cloud LWR site for guest or authenticated embedding.
Guest (unauthenticated) user
Guest users can access embedded Lightning Out 2.0 components on external pages without signing in.
- In the Lightning Out 2.0 Setup UI, add the components to expose on the third-party page.
- In the Linked Community Site tab, select an existing Experience Cloud LWR site or create a new one and save.
- Open Experience Builder for the selected site and complete the configuration:
- Enable guest user access for the site.
- Configure trusted domains for the host page.
- Add the
force:lightningOutLWRContainercomponent to the Lightning Out page. - Set permissions (object, Apex) on the guest user profile as needed.
- Publish the site.
- Install the embed snippet on the host page. The components render for unauthenticated visitors without a sign-in prompt.
force:lightningOutLWRContainer component. This step applies only to the Build Your Own (LWR) template.Registered (authenticated) user
Authenticated community users can access personalized, permission-aware Lightning Out 2.0 components on external pages.
- Complete the site setup steps from the guest scenario.
- Configure an External Client Application with OAuth 2.0 Web Server Flow.
- Obtain an access token with site context. The token response includes
sfdc_community_url. - Construct the frontdoor URL using the site's vforcesite path to mint a community session cookie.
- On the host page, pass the frontdoor URL to the
<lightning-out-application>element. The runtime automatically derives the site prefix from the frontdoor URL.
Authenticated users get a session scoped to the Experience Site, not the org, so their permissions and personalization match the site context.
For more information, see Experience Sites Support for Lightning Out 2.0 in the Lightning Web Components Developer Guide.