Lightning Out (Beta) Requirements
We recommend using Lightning Out 2.0 instead of Lightning Out (beta). Lightning Out 2.0 is a new generally available feature that completely replaces–and isn’t an extension of–Lightning Out (beta), which is still subject to Beta Service Terms. See How Lightning Out 2.0 Compares to Lightning Out (Beta).
Deploying a Lightning web component using Lightning Out (beta) has a few requirements to ensure connectivity and security.
Verify that the remote web container, or origin server, supports these requirements.
- Ability to modify the markup served to the client browser, including both HTML and JavaScript. You must be able to add the Lightning Out (beta) markup.
- Ability to acquire a valid Salesforce session ID.
- Ability to access your Salesforce instance. For example, if the origin server is behind a firewall, it needs permission to access the Internet, at least to reach Salesforce.
Use Lightning Locker, which is a security architecture for Lightning components. Lightning Out (beta) isn’t supported when Lightning Web Security is enabled. We recommend Lightning Web Security as the preferred security architecture for most orgs, but you must use Lightning Locker instead if you use Lightning Out (beta).
Configure your Salesforce org.
- Create a Connected App so that the origin server can authenticate and connect.
- Add the origin server to the Cross-Origin Resource Sharing (CORS) allowlist.
Create a special Lightning Out (beta) app that contains dependency information for all Lightning web components hosted on the origin server.
To work with Lightning Out (beta), you must either set up a custom domain or your Safari users must change their cross-site tracking browser setting. This requirement applies to Safari users on desktop and mobile devices. For more details, see Enable Browser Third-Party Cookies for Lightning Out (Beta).
See Also