Skip to content
← All posts

Β· 2 min read

πŸš€ Introducing Lightning Out 2.0 β€” Salesforce UI, Beyond Salesforce

First published on LinkedIn β†—

With Spring ’26, Salesforce officially releases Lightning Out 2.0, moving it out of beta and into a fully supported, production-ready capability for embedding Salesforce UI in external applications.

Lightning Out 2.0 changes how developers expose Lightning Web Components (LWC) outside Salesforce. Unlike the beta, which had architectural and security limitations, the final release is built for modern web stacks, stronger isolation, and consistent cross-platform UX β€” making custom LWC reuse in external apps a true game changer.

πŸ” What Lightning Out 2.0 Really Is

Lightning Out 2.0 lets you embed custom Lightning Web Components (LWC) β€” the same components built for Salesforce β€” directly into external web apps (React, Angular, plain HTML). It drops the Aura dependency and is built on modern web standards using Lightning Web Runtime (LWR).

In practice, this means:

  • Build once, reuse anywhere: Use the same LWC inside and outside Salesforce
  • Secure by design: Components run in isolated iframes with closed shadow DOM
  • Modern auth: OAuth-based authentication with session bridging via UI Bridge API
  • Better DX & performance: No Aura app, faster load, simpler setup than beta

🎯 Why This Matters

For teams that craft custom LWCs β€” whether they power internal tools, customer portals, or partner dashboards β€” Lightning Out 2.0 is game changing because:

  • You can reuse rich Salesforce UI in external systems without rebuilding it from scratch.
  • The security model protects Salesforce data and component integrity even when hosted outside the platform.
  • Apps built with modern web stacks (React, Vue, Angular, etc.) can now host Salesforce-powered parts natively.

Lightning Out 2.0 isn’t just an incremental iteration β€” it’s a strategic shift in how Salesforce UI assets can be utilized across the enterprise.

βš™οΈ Setup Checklist

1️⃣ LWC Preparation

  • Only custom LWCs are supported (wrap standard ones if needed).
  • No Aura components β€” full LWC-first design.

2️⃣ Org Configuration

a. Lightning Out 2.0 App

  • Create a Lightning Out 2.0 app in Setup β†’ Lightning Out 2.0 App Manager.
  • Add the LWC components you intend to expose externally.
  • Salesforce will generate the Lightning Out script snippet to include on the external site.

b. CORS & CSP

  • Add your external app domain to Salesforce CORS allowlist.
  • Salesforce uses Content Security Policy (CSP) to ensure only allowed external domains load the Lightning Out resources.

3️⃣ Authentication

Lightning Out 2.0 uses industry-standard OAuth 2.0 flows for secure authentication:

  • Configure an External Client App (OAuth) in Salesforce (App Manager).
  • Expose required scopes (e.g., web/full).
  • Your external app performs the OAuth flow and exchanges tokens for a Frontdoor URL via the UI Bridge API β€” this acts as a secure session bridge for the embedded components.

Note: Unauthenticated access is currently NOT supported. Users must authenticate.

4️⃣ Embedding Components (Host App)

In your external app page:

  • Include the generated Lightning Out 2.0 script provided by Salesforce.
  • Add the <lightning-out-application> element, setting the frontdoor URL and the components to load.

Example simplified snippet:

<lightning-out-application
  frontdoor-url="https://yourorg.lightning.force.com/secur/frontdoor.jsp?..."
  components="c-my-component,c-other-component">
</lightning-out-application>
<c-my-component></c-my-component>
<c-other-component></c-other-component>

This element handles bootstrapping the LWC runtime and rendering your components.


5️⃣ Communication & Events

  • Components run inside iframes.
  • Lightning Out 2.0 uses window.postMessage() under the hood so custom events can travel between the host page and the embedded LWCs β€” but you still use the standard CustomEvent API in component code.

Related posts