Prerequisites
- Access to Widgets API to create widget sessions.
- A quote or transaction with the travel-rule requirement.
Installation
Install the SDK via npm:Quick start
The minimal flow has three steps: create a session on your backend, mount the widget on the page, and handle thecomplete event when the user finishes the form.
The container that hosts the widget must have explicit dimensions in CSS — the widget fills the container bounds. Minimum recommended size is 400px × 600px.
Web app integration
Import and initialize the SDK in your application. Make sure the container that will host the widget has explicit dimensions in CSS. The Widget will fill the container bounds. Minimum recommended size is 400px × 600px.- JavaScript/TypeScript
The
session parameter is obtained from the Create Session endpoint.Native app integration
Native mobile applications integrate the Travel Rule Widget using a WebView component that loads an HTML page containing the Travel Rule Widget SDK. To handle Travel Rule Widget events, your native application needs to implement a communication bridge between the WebView and native code. This bridge enables your native app to receive and respond to events from the Travel Rule Widget.WebView HTML template
Create an HTML file that includes the Travel Rule Widget SDK in your JS bundle:The Travel Rule Widget SDK must be included in your WebView bundle (for example, via your build pipeline). Loading the SDK directly from a CDN is not supported.
Setting up the WebView
Configure the WebView and event bridge for your platform:- iOS (Swift)
- Android (Java/Kotlin)
- React Native
Configuration reference
The most common SDK options. See the SDK reference for the full schema and all event types.Troubleshooting
Widget not displaying The widget loads in an iframe, which requires proper Content Security Policy (CSP) configuration. Add the following domains to your CSP directives:- Sandbox:
https://travel-rule-widget.enterprise.sandbox.uphold.com - Production:
https://travel-rule-widget.enterprise.uphold.com
- JavaScript is enabled in the WebView.
- The message bridge is properly registered before the HTML page loads.
- Event handlers match the platform-specific bridge implementation.
Next steps
- Review the complete SDK Reference for all available methods and events.
- See Handle quote requirements and Handle on-hold transactions for practical examples of using the Travel Rule Widget in transactions.