---
schema_version: "1"
id: e161666cc2afc629b01bc7b3814f4e0469f95fa938fff35cfb35e9b1e11d45a4
title: Firing Events from Non-Aura Code
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/events/events-external.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/events-external.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2b15c55aa8481e86479097fe355c4294693b8321fb515eedf6a28c9ceb02ac99
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# 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.

<!-- otherprops: set_clipboard -->
```javascript
var myExternalEvent;
if(window.$A &&
  (myExternalEvent = window.$A.get("e.mynamespace:externalEvent"))) {
    myExternalEvent.setParams({isOauthed:true});
    myExternalEvent.fire();
}
```

**See Also**  


-   [Application Events](https://developer.salesforce.com/docs/platform/aura-platform/guide/events-application.md)
-   [Modifying Components Outside the Framework Lifecycle](https://developer.salesforce.com/docs/platform/aura-platform/js-cb/js-cb-mod-ext-js.md)

