Embeddable Widgets
Configuration
Embed Code
Copy and paste this HTML into your page:
<div class="myallies-widget" data-type="supply-chain" data-ticker="AAPL"></div> <script src="https://www.myallies.com/embed/myallies-widget.js" async></script>
HTML Attributes
| Attribute | Required | Values | Description |
|---|---|---|---|
data-type | Yes | supply-chain, insider-badge, fragility-score | Which widget to render. |
data-ticker | Yes | Any U.S. stock ticker | The stock symbol to display data for. |
data-theme | No | light (default), dark | Color theme for the widget card. |
class | Yes | myallies-widget | Required class for the widget script to detect the element. |
Widget Details
Technical Details
The widget script is a single JavaScript file under 10KB that runs independently with no external dependencies. It uses the Fetch API to retrieve data from the MyAllies Public API, which supports CORS for cross-origin requests. Widgets render inside a shadow DOM container to prevent style conflicts with your existing page styles.
Multiple widgets can be placed on the same page. The script automatically finds all elements with the myallies-widget class and initializes them. For dynamically added widgets, call window.MyAlliesWidgets.init() after inserting new widget elements into the DOM.
Rate Limits
Widget API requests are subject to the same rate limits as the MyAllies Public API. Anonymous requests are limited to 100 requests per minute per IP address. For higher limits, register for a free API key at the MyAllies API portal.