Skip to main content
The Web Widget SDK simplifies Connect Widget integrations.
LEGACY SDKThis page documents the legacy Web SDK. For new integrations, see Web SDK.
After completing this guide, your application will display the Connect Widget using the Web Widget SDK, available on GitHub.
PREREQUISITESSign up for a developer account on the Client Dashboard.

1. Install the Web Widget SDK

Install the SDK at the root of your project using your preferred package manager.

2. Incorporate the SDK

The Web Widget SDK provides multiple modules that you can import and use in your application, depending on your build process.
A CommonJS module is exported by this package and available by requiring @mxenabled/web-widget-sdk. Require this module and build your project with a build tool that supports CommonJS modules (such as browserify).
CommonJS

3. Generate the Widget URL

There are two options to generate the widget URL:

a. Platform API

Use the Request Widget URL endpoint to get a URL. Note that this url expires after ten minutes or upon first use, so you may need to request it again while following this guide.
Then set the URL from the API response in the url Widget class option. See Class Options for a complete list.

b. Proxy Server

The SDK can make requests on your behalf to your backend service that calls the Platform API. Pass the proxy URL to a widget component via the proxy option. See Class Options for a complete list. When using a proxy server, pass the widget’s configurations directly to the widget component.

4. Mount and Unmount the Widget

When you instantiate a widget with options, it mounts itself in the DOM and sets up event listeners. Call the unmount method when closing the widget and before creating a new instance.
SUCCESSYou’ve set up the SDK and embedded the Connect Widget!

Class Options

You can configure the state and behavior of the widget with the following class options.

Troubleshooting

If widget events aren’t triggered, check the following:
  • Ensure your widget URL request is correctly configured for the Web SDK:
    • ui_message_version is set to 4
    • is_mobile_webview is set to false
  • Ensure you use the corresponding widget class for the widget_type in the widget URL request. For example, if you set widget_type to connect_widget, use the ConnectWidget class.

Next Steps

Now that the widget can display in your application, you’ll build some additional flows, specify the data you want to retrieve when a user connects to their financial institution, handle events the widget sends, and more. See Integrate using MX’s Connect Widget.