Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Firing Events from Non-Aura Code

You can fire Aura events from JavaScript code outside an Aura app. For example, your Aura app might need to call out to some non-Aura code, and then have that code communicate back to your Aura app once it's done.

For example, you could call external code that needs to log into another system and return some data to your Aura app by firing an Aura event. Let's call this event mynamespace:externalEvent. The external code fires this event when it’s ready to communicate with an Aura app.

1var myExternalEvent;
2if(window.$A &&
3  (myExternalEvent = window.$A.get("e.mynamespace:externalEvent"))) {
4    myExternalEvent.setParams({isOauthed:true});
5    myExternalEvent.fire();
6}