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

1. Install the SDK

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

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

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 prop. When using a proxy server, pass the widget’s configurations directly to the widget component.
Proxy

3. Import the SDK and Render the Widget

Now that you can generate a widget URL, import components from @mxenabled/react-native-widget-sdk and render them in your application.
SUCCESSYou’ve set up the SDK and embedded the Connect Widget!

Props

You can configure the state and behavior of a widget with the following component props:

OAuth Redirects

To properly handle OAuth redirects from the Connect Widget back to your application when using the React Native SDK, you need to:
  1. Update your application and enable deeplinking from native code into the React Native layer. See Linking for instructions.
  2. Ensure your application has a scheme. You can install and use the URI scheme package to manage your application’s schemes.
  3. Provide your application’s scheme to the widget component with the uiMessageWebviewUrlScheme prop. Expo applications that are not deployed as standalone applications should use clientRedirectUrl instead (see note below).
Scheme
WARNINGExpo applications: Expo applications rely on Expo’s own application scheme. Expo users need to use the clientRedirectUrl prop instead of uiMessageWebviewUrlScheme. Note that this does not apply to standalone Expo applications. If your application is standalone, continue to use the uiMessageWebviewUrlScheme prop.clientRedirectUrl works similarly to uiMessageWebviewUrlScheme, except you need to pass in the full URL to your Expo application and include /oauth_complete at the end of the URL path for the Widget SDK to properly detect the linking event. You can use Expo’s Linking.createURL method to create the URL.

Handling Events

If you’re using the React Native SDK, you’ll listen for widget events by passing callback props in the widget component. The prop names follow the naming scheme below. All payloads include the user_guid (string) and session_guid (string) fields. The following is an example integration that lets you listen to the events we send.

Troubleshooting

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

Next Steps

Now that the widget displays in your application, you’ll build 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.