Lightning Out Considerations and Limitations

Creating an app using Lightning Out is, for the most part, much like creating any app with Lightning components. However, because your components are running “outside” of Salesforce, there are a few issues you want to be aware of. And it’s possible there are changes you might need to make to your components or your app.

The issues you should be aware of can be divided into two categories.

Considerations for Using Lightning Out

Because Lightning Out apps run outside of any Salesforce container, there are things you need to keep in mind, and possibly address.

First, Lightning components depend on setting cookies in a user’s browser. Since Lightning Out runs Lightning components outside of Salesforce, those cookies are “third-party” cookies. Your users need to allow third-party cookies in their browser settings.

The most significant and obvious issue is authentication. There’s no Salesforce container to handle authentication for you, so you have to handle it yourself. This essential topic is discussed in detail in “Authentication from Lightning Out.”

Another important consideration is more subtle. Many important actions your apps support are accomplished by firing various Lightning events. But events are sort of like that tree that falls in the forest. If no one’s listening, does it have an effect? In the case of many core Lightning events, the “listener” is the Lightning Experience or Salesforce1 container, one.app. And if one.app isn’t there to handle the events, they indeed have no effect. Firing those events silently fails.

Standard events are listed in “Event Reference.” Events not supported for use in Lightning Out include the following note:
Note

Note

This event is handled by the one.app container. It’s supported in Lightning Experience and Salesforce1 only.

Limitations With Standard Components

While the core Lightning Out functionality is stable and complete, there are a few interactions with other Salesforce features that we’re still working on.

Chief among these is the standard components built into the Lightning Component framework. Many standard components don’t behave correctly when used in a stand-alone context, such as Lightning Out, and Lightning Components for Visualforce, which is based on Lightning Out. This is because the components implicitly depend on resources available in the one.app container.

Avoid this issue with your own components by making all of their dependencies explicit. Use ltng:require to reference all required JavaScript and CSS resources that aren’t embedded in the component itself.

If you’re using standard components in your apps, they might not be fully styled, or behave as documented, when they’re used in Lightning Out or Lightning Components for Visualforce.