Skip to main content
This guide walks you through installing the Travel Rule Widget SDK and integrating it into your web or native application.

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 the complete 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.
For a more complete example with all event handlers, see Web app integration below. For the complete API, see the SDK reference.

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.
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:

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
Example CSP configuration:
Events not firing in native apps Verify that:
  • 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