This file (embed.js) is meant to be loaded via the <script/> tag into a web application
that would like to embed Aiera modules. It exposes a global window.Aiera namespace
with utilities for loading Aiera modules into iframes inside the web application and
communicating with them.
eventList.load().then(() => { // If you want to bypass the login screen, you must get credentials // via the API and then pass them here. This is optional.
// See [[web/embed#authenticate]] for examples of how to get tokens.
// Once authenticated, you can pass data to the module, such as setting // up a watchlist eventList.on('authenticated', () => { // Set up a watchlist after authentication // eventList.setWatchlist([ // { ticker: 'AAPL' }, // { ISIN: 'US02079K1079' }, // { ticker: 'TLSA' }, // { ticker: 'PTON' }, // ]); }); </script> </body> </html>
By default Aiera modules will display a login screen and ask for existing user credentials
in order to login and gain access to the module. However, some applications may handle user
creation on their own and would prefer to automatically log those users into the module.
For that use case, you can exchange user credentials for auth tokens and then call Module.authenticate
with the tokens to bypass the login screen.
To exchange credentials for auth tokens, you must make a request to Aiera's graphql endpoint with
the following (skip to next section if logging in using an API key):
Embeded Aiera Modules
This file (
embed.js
) is meant to be loaded via the<script/>
tag into a web application that would like to embed Aiera modules. It exposes a globalwindow.Aiera
namespace with utilities for loading Aiera modules into iframes inside the web application and communicating with them.See Module for more details.
Example usage
index.html
Authentication
By default Aiera modules will display a login screen and ask for existing user credentials in order to login and gain access to the module. However, some applications may handle user creation on their own and would prefer to automatically log those users into the module. For that use case, you can exchange user credentials for auth tokens and then call Module.authenticate with the tokens to bypass the login screen.
To exchange credentials for auth tokens, you must make a request to Aiera's graphql endpoint with the following (skip to next section if logging in using an API key):
Logging in using an API key
Examples of getting user auth tokens
These are examples of how to exchange user credentials for tokens that can be passed to Module.authenticate.
bash
javascript
python