Developer Documentation
Widget Integration Guide
Learn how to embed your custom financial widget into your application using an iframe.
1 Overview
This guide shows you how to embed your custom financial widget into your application using an iframe. Your widget is accessible via a single URL that handles data fetching, theming, and emits real-time events back to your application.
What you can do:
• Embed the widget using a simple iframe
• Configure language, theme, security identifiers, and user behavior
• Listen to widget events (load, resize, user interactions, errors)
• Handle security selections in your application (when enabled)
• Auto-resize the widget based on content
2 Quick Start
Basic iframe integration with auto-resize:
3 URL Structure
All widgets share the same base URL structure:
Path Parameters
Query Parameters
To start integrating widgets, you'll need an access token. Please follow the instructions in our Authentication Guide to generate your token.
4 Widget-Specific Properties
The following properties are specific to certain widgets:
5 Selection Behavior (actionType)
The actionType parameter controls how the widget handles clicks on links and securities.
6 Events & postMessage
Widgets send JSON-serialized messages to window.parent via postMessage. Each message has this format:
Event Types
Status Events
load { height: number }Widget fully loaded; provides suggested height.
resize { height: number }Content height changed; use for auto-resize.
success { height: number }Successful state update (e.g., answer rendered).
error { message, status, data?, height }Error inside the widget or underlying services.
Interaction Events
click { id: string, ... }Click events (clipboard, disclaimer, etc.).
hover { id: string, ... }Hover events (where supported).
link-click { url: string, text?: string }Emitted when onLinkClick callback is provided.
Selection Events
security-select { id, ticker?, exchange?, type }Emitted only when actionType=external.
Event Handler Example
7 Theming and Styling
? Theming
| ? Localization
| |
⚠️ Error Handling
| ? Security
|
8 iOS Integration (SwiftUI/UIKit)
For iOS apps, embed the widget using WKWebView with proper postMessage handling:
Key Points for iOS
• Use WKWebView with WKUserContentController for postMessage handling
• Inject JavaScript to bridge iframe postMessage to webkit messageHandler
• Handle height changes to dynamically resize the widget
• Validate message origin for security
• Disable WebView scrolling if you want the widget to control its own height
9 Android Integration (WebView)
For Android apps, use WebView with JavaScript interface to handle postMessage events:
Key Points for Android
• Enable JavaScript and DOM storage in WebView settings
• Use @JavascriptInterface to create a bridge for postMessage handling
• Inject JavaScript after page load to capture iframe messages
• Convert pixel heights using display density for proper sizing
• Handle events on the main thread using post()
10 Mobile Integration Notes
? Responsive DesignWidget automatically adapts to mobile viewports. | ? External NavigationUse |
⚠️ Error HandlingListen for error events for network/auth issues. | ? Secure StorageUse iOS-size: 14px;">• Embed the widget using a simple iframe |