Widget Events
A list of Connect Widget events, how to handle them, and best practices
When key actions occur in the Connect Widget, widget events are sent to you with the details that you need to respond to the event in your codebase.
Don't use widget events for keeping data in sync between platforms. Webhooks are more reliable when coordinating events between your servers and MX servers.
How to Handle Events
The way you'll handle widget events depends on your integration method.
- Web Widget SDK
- React Native SDK
- JavaScript Loader
- WebView
If you're using the Web Widget SDK, you'll listen for widget events by passing callback functions in the widget options object to the class. The option names follow this naming scheme.
| Event | Prop |
|---|---|
| Widget | on<event name> |
| Entity | on<entity><action> |
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.
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onBackToSearch: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Context: ${payload.context}`)_10 }_10})
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.
| Event | Prop |
|---|---|
| Widget | on<event name> |
| Entity | on<entity><action> |
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.
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onBackToSearch={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Context: ${payload.context}`)_11 }_11/>
When using the JavaScript Loader, events have the following properties:
- The
mxfield (boolean) lets you filter out events coming from MX. - The
typefield (string) identifies what the event represents.- Schema:
mx/<entity|widget>/<event> - Example:
mx/connect/institutionSelected
- Schema:
- The
metadataobject contains:user_guid(string)session_guid(string)x_callback_payload(returns if theX-CALLBACK-PAYLOADheader was defined in the Platform API widget URL request)
The following is an example integration that lets you listen to the events we send.
_10function handleEvent(event) {_10 if (event.data.mx) {_10 // handle the mx widget event using event.data.type and event.data.metadata._10 }_10}_10_10window.addEventListener('message', handleEvent)
When embedding the widget in a WebView, events have the following properties:
- The
mxfield (boolean) lets you filter out events coming from MX. - The
typefield (string) identifies what the event represents.- Schema:
mx/<entity|widget>/<event> - Example:
mx/connect/institutionSelected
- Schema:
- The
metadataobject contains:user_guid(string)session_guid(string)x_callback_payload(returns if theX-CALLBACK-PAYLOADheader was defined in the Platform API widget URL request)
Ensure is_mobile_webview is set to true when requesting a widget URL, which affects the following:
- Sends events with
window.location = {scheme}://{event path}?metadata={json encoded metadata}instead ofwindow.postMessage(message). You must capture the URLs delivered viawindow.location = "someurl"calls within the iFrame, parse out the path and query string, then JSON-decode themetadatafield. These events will all have themx://prefix and the following format:mx://<entity|widget>/<event>?metadata=<metadata as an encodedURI JSON string>. - Sets
oauth_referral_sourcetoAPPso the OAuth flow will redirect back to a native application instead of sending an event to the opening window. - Prevents the widget from automatically trying to open an OAuth window; instead it will send the OAuth requested event so your app can correctly open the OAuth window in the user agent.
By default, the ui_message_webview_url_scheme will be mx. This can be configured when requesting a widget URL by setting the value to whatever custom string you prefer, for example yourAppScheme.
Your app must capture all navigation events to mx:// and custom schemes like yourAppScheme:// so the WebView doesn't lose the Connect Widget session and the app doesn't break.
Example Navigation Event Schema
_10Schema:_10{ui_message_webview_url_scheme}://{some/path}?metadata={jsonString}_10_10Default:_10mx://connect/loaded?metadata={jsonString}_10_10Custom:_10yourAppScheme://connect/institutionSearch?metadata={jsonString}
Suggested Configuration for WebViews
Code Examples
Notable Widget Events
The section details important widget events and what to do when you receive them.
| Widget Event | What To Do |
|---|---|
| Back to Search | If you disabled the search institution step by setting disable_institution_search: true, listen to this event to know when your user will be navigated to the search step so you can close the widget. |
| Connect Loaded | Track the start of the user's journey. You can also use this if you intend on hiding the widget from the user until you know it's loaded. |
| Institution Search and Institution Selected | Use these events to track trends in institutions your users want to connect to. If you identify a trend, you can customize the top 10 institutions in the default institutions list. You could also create UI that calls out and loads your users to connect to that institution directly. |
| Member Connected, Primary Action Selected | If you don't want the end user to return to connect more accounts after they connected to one, close the widget. |
| OAuth Requested | This event only applies if you embedded the widget inside a mobile app using a WebView, or using an iFrame inside a WebView. Send the user to the OAuth provider's site, opening the URL (contained in the event's metadata) in the device’s default browser. |
| Widget Ping | Used to keep the widget session alive. See Handling Session Timeouts for more info. |
Back to Search
Sent when the user selects a button that navigates to the search step, as defined in the Step Change event. Used in relation with disable_institution_search widget configuration option.
Recommended use: If you disabled the search institution step by setting disable_institution_search: true, listen to this event to know when your user will be navigated to the search step so you can close the widget.
Fields:
user_guid(string)session_guid(string)- (Only for SDKs)
context(string)
If you listen for this event, don't listen for any of the Primary Action events. You'll receive a double payload.
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onBackToSearch: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Context: ${payload.context}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onBackToSearch={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Context: ${payload.context}`)_11 }_11/>
_10{_10 "type": "mx/connect/connected/backToSearch",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123"_10 }_10}
Connect Loaded
Sent when the Connect Widget loads. It's often useful to know what “step” or view the user started on.
Recommended use: Track the start of the user's journey. You can also use this if you intend on hiding the widget from the user until you know it's loaded.
Fields:
user_guid(string)session_guid(string)initial_step(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onLoaded: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Initial step: ${payload.initial_step}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onLoaded={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Initial step: ${payload.initial_step}`)_11 }_11/>
_10{_10 "type": "mx/connect/loaded",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "initial_step": "search"_10 }_10}
The initial_step can be:
| Value | Definition |
|---|---|
connected | The initial step when configured with current_member_guid and the member is in a connected state. |
disclosure | The initial step when configured to display the disclosure screen that shows the MX privacy policy first. This is optional and is turned off by default. |
enterCreds | The initial step when configured with current_institution_guid or current_member_guid, and updated_credentials set to true. |
loginError | The initial step when configured with current_member_guid and the member is in an error state. |
mfa | The initial step when configured with current_member_guid and the member has encountered multi-factor authentication. |
search | The default initial step. |
verifyExistingMember | The initial step when configured with data_request.products set to account_verification. |
Enter Credentials
Sent when a user submits credentials for a given institution for the first time.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
user_guid(string)session_guid(string)institution(object)code(string)guid(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onEnterCredentials: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Institution: ${payload.institution}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onEnterCredentials={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Institution: ${payload.institution}`)_11 }_11/>
_12{_12 "type": "mx/connect/enterCredentials",_12 "mx": true,_12 "metadata": {_12 "user_guid": "USR-123",_12 "session_guid": "ANS-123",_12 "institution": {_12 "code": "mxbank",_12 "guid": "INS-123"_12 }_12 }_12}
Initial Data Ready
This event is deprecated and should not be used in new implementations.
This event only applies if you're using Platform API version 20250224.
Triggered when some initial data you requested has aggregated and is ready for retrieval.
When you receive this event, you can close the widget and retrieve some initial data to avoid making the user wait until every requested product finishes aggregating.
For more details, including what initial data is sent based on the products you set, see Accessing Priority Data.
_10{_10 "type": "mx/connect/initialDataReady",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "member_guid": "MBR-123"_10 }_10}
Institution Search
Sent when the end user searches for an institution. This is useful in determining what users are searching for.
Recommended use: Track this to find trends in institutions your users want to connect to. If you identify a trend, you can customize the top 10 institutions in the default institutions list. You could also create UI that calls out the FI directly and loads your users to connect to that institution directly.
Fields:
user_guid(string)session_guid(string)query(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onInstitutionSearch: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Query: ${payload.query}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onInstitutionSearch={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Query: ${payload.query}`)_11 }_11/>
_10{_10 "type": "mx/connect/institutionSearch",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "query": "MX Bank"_10 }_10}
Institution Selected
Sent when an end user selects an institution from the institution list.
Recommended use: Similar to the Institution Search event. Track this to find trends in institutions your users want to connect to. If you identify a trend, you can customize the top 10 institutions in the default institutions list. You could also create UI that calls out the FI directly and loads your users to connect to that institution directly.
Fields:
user_guid(string)session_guid(string)code(string)guid(string)name(string)url(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_12const widget = widgetSdk.ConnectWidget({_12 url: "https://widgets.moneydesktop.com/md/connect/...",_12_12 onSelectedInstitution: (payload) => {_12 console.log(`User guid: ${payload.user_guid}`) // string_12 console.log(`Session guid: ${payload.session_guid}`) // string_12 console.log(`Code: ${payload.code}`) // string_12 console.log(`Guid: ${payload.guid}`) // string_12 console.log(`Name: ${payload.name}`) // string_12 console.log(`Url: ${payload.url}`) // string_12 }_12})
_14import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_14_14<ConnectWidget_14 url="https://widgets.moneydesktop.com/md/connect/..."_14_14 onSelectedInstitution={(payload) => {_14 console.log(`User guid: ${payload.user_guid}`)_14 console.log(`Session guid: ${payload.session_guid}`)_14 console.log(`Code: ${payload.code}`)_14 console.log(`Guid: ${payload.guid}`)_14 console.log(`Name: ${payload.name}`)_14 console.log(`Url: ${payload.url}`)_14 }_14/>
_12{_12 "type": "mx/connect/selectedInstitution",_12 "mx": true,_12 "metadata": {_12 "code": "mxbank",_12 "guid": "INS-123",_12 "name": "MX Bank",_12 "session_guid": "ANS-123",_12 "url": "www.example.com",_12 "user_guid": "USR-123"_12 }_12}
Invalid Data
Sent when there are no valid demand deposit (DDA) accounts on the member.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
code(string)member_guid(string)session_guid(string)user_guid(string)
Conditions
"mode": "verification"- The member receives an error as one of the codes below.
The code can be:
| Value | Definition |
|---|---|
1000 | No demand deposit (DDA) accounts for verification job. |
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 invalidData: (payload) => {_10 console.log(`Code: ${payload.code}`)_10 console.log(`Member guid: ${payload.member_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`User guid: ${payload.user_guid}`)_10 }_10})
_12import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_12_12<ConnectWidget_12 url="https://widgets.moneydesktop.com/md/connect/..."_12_12 invalidData={(payload) => {_12 console.log(`Code: ${payload.code}`)_12 console.log(`Member guid: ${payload.member_guid}`)_12 console.log(`Session guid: ${payload.session_guid}`)_12 console.log(`User guid: ${payload.user_guid}`)_12 }_12/>
_10{_10 "type": "mx/connect/invalidData",_10 "mx": true,_10 "metadata": {_10 "code": "1000",_10 "member_guid": "MBR-123",_10 "session_guid": "ANS-123",_10 "user_guid": "USR-123"_10 }_10}
Invalid Data, Primary Action Selected
Sent when there are no valid demand deposit (DDA) accounts on the member and the end user selects Try again on the associated error screen. When the end user selects Try again, the widget will send them to the institution search screen.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
member_guid(string)session_guid(string)user_guid(string)
Conditions
data_request.productsincludesaccount_verification.disable_institution_searchis set totrue.- The member doesn't have any valid DDA accounts.
- The user selects Try again on the error screen.
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 invalidDataPrimaryAction: (payload) => {_10 console.log(`Member guid: ${payload.member_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`User guid: ${payload.user_guid}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 invalidDataPrimaryAction={(payload) => {_11 console.log(`Member guid: ${payload.member_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`User guid: ${payload.user_guid}`)_11 }_11/>
_10{_10 "type": "mx/connect/invalidData/primaryAction",_10 "mx": true,_10 "metadata": {_10 "member_guid": "MBR-123",_10 "session_guid": "ANS-123",_10 "user_guid": "USR-123"_10 }_10}
Member Connected
Sent when a member has successfully connected and the data you requested in your Widget URL request has finished aggregating.
Recommended use: Retrieve the data you requested in your Widget URL request, which has finished aggregating. If you don't want the user to acknowledge they connected to a member in our UI, you could close the widget after receiving this event and present your own success screen.
Fields:
user_guid(string)session_guid(string)member_guid(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onMemberConnected: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Member guid: ${payload.member_guid}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onMemberConnected={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Member guid: ${payload.member_guid}`)_11 }_11/>
_10{_10 "type": "mx/connect/memberConnected",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "member_guid": "MBR-123"_10 }_10}
Member Connected, Primary Action Selected
Sent when the user selects the primary button on the connected step.
Recommended use: If you don't want the end user to return to connect more accounts, close the widget.
Fields:
user_guid(string)session_guid(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onConnectedPrimaryAction: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 }_10})
_10import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_10_10<ConnectWidget_10 url="https://widgets.moneydesktop.com/md/connect/..."_10_10 onConnectedPrimaryAction={(payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 }_10/>
_10{_10 "type": "mx/connect/connected/primaryAction",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123"_10 }_10}
Member Connection Error
Sent when a member has encountered an error state.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
user_guid(string)session_guid(string)member(object)guid(string)connection_status(number)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onMemberError: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Member guid: ${payload.member.guid}`)_10 console.log(`Connection status: ${payload.member.connection_status}`)_10 }_10})
_12import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_12_12<ConnectWidget_12 url="https://widgets.moneydesktop.com/md/connect/..."_12_12 onMemberError={(payload) => {_12 console.log(`User guid: ${payload.user_guid}`)_12 console.log(`Session guid: ${payload.session_guid}`)_12 console.log(`Member guid: ${payload.member.guid}`)_12 console.log(`Connection status: ${payload.member.connection_status}`)_12 }_12/>
_12{_12 "type": "mx/connect/memberError",_12 "mx": true,_12 "metadata": {_12 "user_guid": "USR-123",_12 "session_guid": "ANS-123",_12 "member": {_12 "guid": "MBR-123",_12 "connection_status": 6_12 }_12 }_12}
Member Create Error
Sent when a member failed to get created when credentials were entered.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
user_guid(string)session_guid(string)institution_guid(string)institution_code(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onCreateMemberError: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Institution guid: ${payload.institution_guid}`)_10 console.log(`Institution code: ${payload.institution_code}`)_10 }_10})
_12import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_12_12<ConnectWidget_12 url="https://widgets.moneydesktop.com/md/connect/..."_12_12 onCreateMemberError={(payload) => {_12 console.log(`User guid: ${payload.user_guid}`)_12 console.log(`Session guid: ${payload.session_guid}`)_12 console.log(`Institution guid: ${payload.institution_guid}`)_12 console.log(`Institution code: ${payload.institution_code}`)_12 }_12/>
_10{_10 "type": "mx/connect/createMemberError",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "institution_guid": "INS-123",_10 "institution_code": "mxbank"_10 }_10}
Member Deleted
Sent when a member has been deleted in the widget.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
user_guid(string)session_guid(string)member_guid(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onMemberDeleted: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Member guid: ${payload.member_guid}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onMemberDeleted={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Member guid: ${payload.member_guid}`)_11 }_11/>
_10{_10 "type": "mx/connect/memberDeleted",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "member_guid": "MBR-123"_10 }_10}
Member Status Update
Sent when a member’s connection status has changed while connecting.
Recommended use: Useful for determining the current connection status of the member. If the status is CONNECTED, you can start polling to ensure that data is ready for retrieval. If the status is related to an error, you can begin a resolution flow depending on the error.
Fields:
user_guid(string)session_guid(string)member_guid(string)connection_status(number)
A connection_status of 6 (CONNECTED) doesn't mean data is available yet. To ensure that data is available, refer to the member connected event instead.
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onMemberStatusUpdate: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Member guid: ${payload.member_guid}`)_10 console.log(`Connection status: ${payload.connection_status}`)_10 }_10})
_12import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_12_12<ConnectWidget_12 url="https://widgets.moneydesktop.com/md/connect/..."_12_12 onMemberStatusUpdate={(payload) => {_12 console.log(`User guid: ${payload.user_guid}`)_12 console.log(`Session guid: ${payload.session_guid}`)_12 console.log(`Member guid: ${payload.member_guid}`)_12 console.log(`Connection status: ${payload.connection_status}`)_12 }_12/>
_10{_10 "type": "mx/connect/memberStatusUpdate",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "member_guid": "MBR-123",_10 "connection_status": 6_10 }_10}
Microdeposit Account Details Submitted
Sent when the end user submits account details for a given institution for the first time and a microdeposit object is created on the MX system.
For guidance, see Microdeposits Workflow in the Connect Widget.
Fields:
user_guid(string)session_guid(string)microdeposit_guid(string)
_10{_10 "type": "mx/connect/microdeposits/detailsSubmitted",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "microdeposit_guid": "MIC-123"_10 }_10}
Microdeposit Blocked Routing Number
Sent when the end user submits a blocked routing number on the Enter Details step.
For guidance, see Microdeposits Workflow in the Connect Widget.
Fields:
user_guid(string)session_guid(string)routing_number(string)reason(string). Possible values are:BLOCKED: MX has blocked this routing number. Microdeposit verification can't proceed.CLIENT_BLOCKED: An MX client has requested that this routing number be blocked. Microdeposit verification can't proceed.IAV_PREFERRED: The institution associated with the routing number has an Instant Account Verification (IAV) connection that is preferred over microdeposit verification. The IAV flow will be suggested to the end user.
_10{_10 "type": "mx/connect/microdeposits/blockedRoutingNumber",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "routing_number": "123456789", # This is the user-entered routing number_10 "reason": "BLOCKED",_10 }_10}
Microdeposit Come Back, Primary Action Selected
Sent when the end user selects the primary button on the Come Back step. This step is visible while the microdeposit is in the REQUESTED status.
For guidance, see Microdeposits Workflow in the Connect Widget.
Fields:
user_guid(string)session_guid(string)microdeposit_guid(string)
_10{_10 "type": "mx/connect/microdeposits/comeBack/primaryAction",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "microdeposit_guid": "MIC-123"_10 }_10}
Microdeposit Error, Primary Action Selected
Sent when the end user selects the primary button on the Error step. This page is visible after entering deposits and getting a PREVENTED status.
For guidance, see Microdeposits Workflow in the Connect Widget.
Fields:
user_guid(string)session_guid(string)microdeposit_guid(string)microdeposit_status(string)
_10{_10 "type": "mx/connect/microdeposits/error/primaryAction",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "microdeposit_guid": "MIC-123",_10 "microdeposit_status": "PREVENTED"_10 }_10}
Microdeposit Flow Loaded
Sent when the microdeposit flow is loaded in the Connect Widget.
For guidance, see Microdeposits Workflow in the Connect Widget.
Fields:
user_guid(string)session_guid(string)initial_step(string)
_10{_10 "type": "mx/connect/microdeposits/loaded",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "initial_step": "enterDetails"_10 }_10}
Microdeposit Verified
Sent when an end user successfully verifies the microdeposit amounts.
For guidance, see Microdeposits Workflow in the Connect Widget.
Fields:
user_guid(string)session_guid(string)microdeposit_guid(string)
_10{_10 "type": "mx/connect/microdeposits/verified",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "microdeposit_guid": "MIC-123"_10 }_10}
Microdeposit Verified, Primary Action Selected
Sent when the end user selects the primary button on Verified step. This step is visible after entering the correct deposit amounts.
For guidance, see Microdeposits Workflow in the Connect Widget.
Fields:
user_guid(string)session_guid(string)
_10{_10 "type": "mx/connect/microdeposits/verified/primaryAction",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123"_10 }_10}
OAuth Error
Sent when the user lands on the OAuth error page.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
user_guid(string)session_guid(string)member_guid(optional) (string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onOAuthError: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Member guid: ${payload.member_guid}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onOAuthError={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Member guid: ${payload.member_guid}`)_11 }_11/>
_10{_10 "type": "mx/connect/oauthError",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "member_guid": "MBR-123"_10 }_10}
OAuth Requested
This event only applies if you embedded the widget inside a mobile app using a WebView, or using an iFrame inside a WebView.
Sent when the user navigates to the OAuth provider's site. Note that the redirect doesn't happen in WebViews. The native app will need to use this event to send the user to the URL contained in the metadata.
The URL given in the payload will always be an MX URL. The user will be routed to us first (for example, mx://connect/oauthRequested?metadata={...JSON encoded payload ...}), then to the provider.
Recommended use: Only use if you embedded the widget inside a mobile app using a WebView, or using an iFrame inside a WebView.
Fields:
user_guid(string)session_guid(string)url(string)member_guid(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
By passing your own method to this prop, you're overriding the default behavior of the SDK which is to load the OAuth URL in a new browser tab.
If you override this functionality, you must use the device's browser to authenticate the user with OAuth. You cannot use WebViews or iframes. This approach enhances security and leverages saved passwords and password managers. Many OAuth providers also block their web applications from loading in iframes or WebViews. Many OAuth providers also block their web applications from loading in iframes or WebViews.
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onOAuthRequested: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Url: ${payload.url}`)_10 console.log(`Member guid: ${payload.member_guid}`)_10 }_10})
By passing your own method to this prop, you're overriding the default behavior of the SDK which is to load the OAuth URL in a new browser tab.
If you override this functionality, you must use the device's browser to authenticate the user with OAuth. You cannot use WebViews or iframes. This approach enhances security and leverages saved passwords and password managers. Many OAuth providers also block their web applications from loading in iframes or WebViews. Many OAuth providers also block their web applications from loading in iframes or WebViews.
_12import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_12_12<ConnectWidget_12 url="https://widgets.moneydesktop.com/md/connect/..."_12_12 onOAuthRequested={(payload) => {_12 console.log(`User guid: ${payload.user_guid}`)_12 console.log(`Session guid: ${payload.session_guid}`)_12 console.log(`Url: ${payload.url}`)_12 console.log(`Member guid: ${payload.member_guid}`)_12 }_12/>
_10{_10 "type": "mx/connect/oauthRequested",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "url": "https://something.com",_10 "member_guid": "MBR-123"_10 }_10}
Step Change
Connect flows and steps are constantly being evaluated, updated, and optimized. The steps listed below are subject to change without notice.
Sent when the end user changes from one “step” to another.
Recommended use: Intended for analytics tracking purposes only, and not for controlling or altering the user's experience.
Fields:
user_guid(string)session_guid(string)previous(string)current(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onStepChange: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Previous: ${payload.previous}`)_10 console.log(`Current: ${payload.current}`)_10 }_10})
_12import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_12_12<ConnectWidget_12 url="https://widgets.moneydesktop.com/md/connect/..."_12_12 onStepChange={(payload) => {_12 console.log(`User guid: ${payload.user_guid}`)_12 console.log(`Session guid: ${payload.session_guid}`)_12 console.log(`Previous: ${payload.previous}`)_12 console.log(`Current: ${payload.current}`)_12 }_12/>
_10{_10 "type": "mx/connect/stepChange",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "previous": "search",_10 "current": "enterCreds"_10 }_10}
Possible step values for previous and current can be:
| Current/Previous Value | Definition |
|---|---|
addManualAccount | Where the user creates manual accounts. Manual accounts are not currently offered in the Platform API; partners should not expect to see this value. |
connected | Where the user lands when they have successfully connected. |
connecting | Where the user goes while the connection is being attempted. |
disclosure | Where the user reads the MX privacy policy and agrees by selecting Continue. This is optional and is turned off by default. |
enterCreds | Where the user enters credentials for a particular institution. |
error | Where the user lands when the member create was unsuccessful due to user or system error. |
existingMember | Where the user lands if they are trying to add a member they have previously added. |
loginError | Where the user lands when they have unsuccessfully connected due to user or system error. |
mfa | Where the user enters in MFA responses. |
oauth | Where the user goes instead of enter credentials if the institution and client supports oauth. |
search | Where the user searches for institutions. |
timeOut | When the user has been connecting for more than 60 seconds without any updates to the member, if the member's connection_status isn't PENDING. |
verifyExistingMember | Where the user can verify existing members when data_request.products includes account_verification. |
Submit MFA
Sent when a user submits an MFA answer.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
user_guid(string)session_guid(string)member_guid(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onSubmitMFA: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Member guid: ${payload.member_guid}`)_10 }_10})
_11import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_11_11<ConnectWidget_11 url="https://widgets.moneydesktop.com/md/connect/..."_11_11 onSubmitMFA={(payload) => {_11 console.log(`User guid: ${payload.user_guid}`)_11 console.log(`Session guid: ${payload.session_guid}`)_11 console.log(`Member guid: ${payload.member_guid}`)_11 }_11/>
_10 {_10 "type": "mx/connect/submitMFA",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123",_10 "member_guid": "MBR-123"_10 }_10 }
Update Credentials
Sent when a user submits credentials while trying to update their existing credentials.
Recommended use: Use as needed for your implementation, or for informational and tracking purposes.
Fields:
user_guid(string)session_guid(string)member_guid(string)institution(object)code(string)guid(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onUpdateCredentials: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 console.log(`Member guid: ${payload.member_guid}`)_10 console.log(`Institution: ${payload.institution}`)_10 }_10})
_12import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_12_12<ConnectWidget_12 url="https://widgets.moneydesktop.com/md/connect/..."_12_12 onUpdateCredentials={(payload) => {_12 console.log(`User guid: ${payload.user_guid}`)_12 console.log(`Session guid: ${payload.session_guid}`)_12 console.log(`Member guid: ${payload.member_guid}`)_12 console.log(`Institution: ${payload.institution}`)_12 }_12/>
_13{_13 "type": "mx/connect/updateCredentials",_13 "mx": true,_13 "metadata": {_13 "user_guid": "USR-123",_13 "session_guid": "ANS-123",_13 "member_guid": "MBR-123",_13 "institution": {_13 "code": "mxbank",_13 "guid": "INS-123"_13 }_13 }_13}
Widget Load
Sent when the app is loaded.
This event applies to all MX widgets. For the Connect Widget specifically, there is a separate event—Connect Loaded—that's sent when the widget loads and also includes the initial view the user started on. For more details, see Connect Loaded.
Only contains type (string) and mx (boolean).
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onLoad: (payload) => {_10 console.log(`Type: ${payload.type}`)_10 console.log(`MX: ${payload.mx}`)_10 }_10})
_10import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_10_10<ConnectWidget_10 url="https://widgets.moneydesktop.com/md/connect/..."_10_10 onLoad={(payload) => {_10 console.log(`Type: ${payload.type}`)_10 console.log(`MX: ${payload.mx}`)_10 }_10/>
_10{_10 "type": "mx/load",_10 "mx": true_10}
Widget Ping
Used to keep the widget session alive.
See Handling Session Timeouts for more info.
Fields:
user_guid(string)session_guid(string)
- Web Widget SDK
- React Native SDK
- JavaScript Loader
_10const widget = widgetSdk.ConnectWidget({_10 url: "https://widgets.moneydesktop.com/md/connect/...",_10_10 onPing: (payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 }_10})
_10import { ConnectWidget } from "@mxenabled/react-native-widget-sdk"_10_10<ConnectWidget_10 url="https://widgets.moneydesktop.com/md/connect/..."_10_10 onPing={(payload) => {_10 console.log(`User guid: ${payload.user_guid}`)_10 console.log(`Session guid: ${payload.session_guid}`)_10 }_10/>
_10{_10 "type": "mx/ping",_10 "mx": true,_10 "metadata": {_10 "user_guid": "USR-123",_10 "session_guid": "ANS-123"_10 }_10}