Link Webview SDK
Reference for integrating with the Link Webview JavaScript SDK
Plaid does not recommend the use of webviews for new integrations if an alternative integration method is possible. Webviews require additional work to correctly support OAuth flows and do not provide native support for App-to-App, resulting in reduced conversion. Plaid's SDKs for Android, iOS, and React Native provide the easiest and best way to build a mobile Plaid experience and are recommended for all developers whenever possible.
Beginning January 1, 2024, all Webview-based integrations will need to extend the Webview handler for redirects in order to support Chase OAuth. This can be accomplished with code samples for iOS and Android. For more details, see Extending webview instances to support certain institutions in the OAuth Guide and the in-process Webview deprecation notice.
Overview
To integrate and use Plaid Link inside a Webview, we recommend starting with one of our sample Webview apps:
Each example app is runnable (on both simulators and devices) and includes code to initialize Link and process events sent from Link to your app via HTTP redirects.

Installation
Link is optimized to work within Webviews, including on iOS and Android. The Link initialization URL to use for Webviews is:
1https://cdn.plaid.com/link/v2/stable/link.htmlThe Link configuration options for a Webview integration are passed via querystring rather than via a client-side JavaScript call. See the create section below for details on the available initialization parameters.
Communication between Link and your app
Communication between the Webview and your app is handled by HTTP redirects rather than client-side JavaScript callbacks. These redirects should be intercepted by your app. The example apps include sample code to do this.
All redirect URLs have the scheme plaidlink. The event type is communicated via the URL host and data is passed via the querystring.
1plaidlink://There are three supported events, connected, exit, and event, which are documented below.
Create
isWebviewtrue, to trigger the Webview integration.tokenlink_token to authenticate your app with Link. This is a short lived, one-time use token that should be unique for each Link session. In addition to the primary flow, a link_token can be configured to launch Link in update mode. See the /link/token/create endpoint for a full list of configurations.receivedRedirectUrireceivedRedirectUri is required to support OAuth authentication flows when re-launching Link on a mobile device. Note that any unsafe ASCII characters in the receivedRedirectUri in the webview query string must be URL-encoded.keypublic_key is no longer used for new implementations of Link. If your integration is still using a public_key, see the migration guide to upgrade to using a link_token. See the maintenance guide to troubleshoot any public_key issues.1https://cdn.plaid.com/link/v2/stable/link.html2 ?isWebview=true3 &token="GENERATED_LINK_TOKEN"4 &receivedRedirectUri=connected
The connected event is analogous to the onSuccess callback in Link Web and is sent when a user successfully links an Item. The following information is available from the querystring event:
public_tokeninstitution_name'Wells Fargo'institution_idaccountsaccounts will only include selected accounts._idaccount_idtypesubtypeverification_statusverification_status. See Auth accounts for a full list of possible values.class_typebusiness or personal account.transfer_statusCOMPLETE– The transfer was completed.INCOMPLETE– The transfer could not be completed. For help, see Troubleshooting transfers.
COMPLETE, INCOMPLETElink_session_id1plaidlink://connected2 ?public_token=public-sandbox-fb7cca4a-82e6-47073 &institution_id=ins_34 &institution_name=Chase5 &accounts='[{"_id":"QPO8Jo8vdDHMepg41PBwckXm4KdK1yUdmXOwK", "meta": {"name":"Plaid Savings", "number": "0000"}, "subtype": "checking", "type": "depository" }]'6 &link_session_id=79e772be-547d-4c9c-8b76-4ac4ed4c441a1"accounts": [2 {3 "_id": "ygPnJweommTWNr9doD6ZfGR6GGVQy7fyREmWy",4 "meta": {5 "name": "Plaid Checking",6 "number": "0000",7 },8 "type": "depository",9 "subtype": "checking",10 "verification_status": ""11 },12 {13 "_id": "9ebEyJAl33FRrZNLBG8ECxD9xxpwWnuRNZ1V4",14 "meta": {15 "name": "Plaid Saving",16 "number": "1111",17 },18 "type": "depository",19 "subtype": "savings"20 }21 ...22]exit
The exit event is analogous to the onExit callback and is sent when a user exits Link without successfully linking an Item, or when an error occurs during Link initialization. Note that on Android devices, an exit event will not be sent if the user exits Link through a system action, such as hitting the browser back button. The following information is available from the querystring:
statusrequires_questionsrequires_selectionsrequires_codechoose_devicerequires_credentialsrequires_account _selectionrequires_oauthinstitution_not_foundinstitution_not _supportederror_typeerror_codeerror_type has a specific set of error_codes.error_messagedisplay_messagenull if the error is not related to user action. This may change over time and is not safe for programmatic use.institution_nameWells Fargoinstitution_idlink_session_idrequest_id1plaidlink://exit2 ?status=requires_credentials3 &error_type=ITEM_ERROR4 &error_code=ITEM_LOGIN_REQUIRED5 &error_display_message=The%20credentials%20were%20not%20correct.%20Please%20try%20again.6 &error_message=the%20credentials%20were%20not%20correct7 &institution_id=ins_38 &institution_name=Chase9 &link_session_id=79e772be-547d-4c9c-8b76-4ac4ed4c441a10 &request_id=m8MDnv9okwxFNBVevent
The event message is analogous to the Link Web onEvent callback and is called as the user moves through the Link flow. The querystring will always contain all possible keys, though not all keys will have values. The event_name will dictate which keys are populated.
event_nameBANK_INCOME_INSIGHTS _COMPLETEDCLOSE_OAUTHCONNECT_NEW _INSTITUTIONERRORerror_code metadata.FAIL_OAUTHHANDOFFMATCHED_SELECT _INSTITUTIONrouting_number was provided when calling /link/token/create. To distinguish between the two scenarios, see metadata.match_reason.MATCHED_SELECT_VERIFY _METHODOPENOPEN_MY_PLAIDOPEN_OAUTHSEARCH_INSTITUTIONSELECT_BRANDSELECT_BRAND event is only emitted for large financial institutions with multiple online banking portals.SELECT_DEGRADED _INSTITUTIONDEGRADED health status and was shown a corresponding message.SELECT_DOWN _INSTITUTIONDOWN health status and was shown a corresponding message.SELECT_FILTERED _INSTITUTIONSELECT_INSTITUTIONSKIP_SUBMIT_PHONESUBMIT_ACCOUNT_NUMBERaccount_number_mask metadata to indicate the mask of the account number the user provided.SUBMIT_CREDENTIALSSUBMIT_DOCUMENTSSUBMIT_DOCUMENTS_ERRORSUBMIT_DOCUMENTS _SUCCESSSUBMIT_MFASUBMIT_PHONESUBMIT_ROUTING_NUMBERrouting_number metadata to indicate user's routing number.TRANSITION_VIEWTRANSITION_VIEW event indicates that the user has moved from one view to the next.VERIFY_PHONEVIEW_DATA_TYPESerror_typeERROR, EXIT.error_codeERROR, EXIT.error_messageERROR, EXIT.exit_statusEXITinstitution_idinstitution_nameinstitution_search _querySEARCH_INSTITUTION.is_update_modeOPEN.match_reasonreturning_user or routing_number if emitted by: MATCHED_SELECT_INSTITUTION.
Otherwise, this will be SAVED_INSTITUTION or AUTO_SELECT_SAVED_INSTITUTION if emitted by: SELECT_INSTITUTION.mfa_typecode, device, questions, selections. Emitted by: SUBMIT_MFA and TRANSITION_VIEW when view_name is MFAview_nameTRANSITION_VIEW.ACCEPT_TOSCONNECTEDCONSENTCREDENTIALDATA_TRANSPARENCYDATA_TRANSPARENCY _CONSENTDOCUMENTARY _VERIFICATIONERROREXITKYC_CHECKLOADINGMATCHED_CONSENTMATCHED_CREDENTIALMATCHED_MFAMFANUMBERSOAUTHRECAPTCHARISK_CHECKSCREENINGSELECT_ACCOUNTSELECT_BRANDSELECT_INSTITUTIONSELECT_SAVED_ACCOUNTSELECT_SAVED _INSTITUTIONSELFIE_CHECKSUBMIT_PHONEVERIFY_PHONEVERIFY_SMSrequest_idlink_session_idlink_session_id is a unique identifier for a single session of Link. It's always available and will stay constant throughout the flow. Emitted by: all events.timestamp2017-09-14T14:42:19.350Z. Emitted by: all events.selectionselection is used to describe selected verification method, then possible values are phoneotp or password; if selection is used to describe the selected Flexible Auth flow, then possible values are flow_type_manual or flow_type_instant. Emitted by: MATCHED_SELECT_VERIFY_METHOD and SELECT_AUTH_TYPE.1plaidlink://event2 &event_name=SELECT_INSTITUTION3 ?error_type=ITEM_ERROR4 &error_code=ITEM_LOGIN_REQUIRED5 &error_message=the%20credentials%20were%20not%20correct6 &exit_status7 &institution_id=ins_558 &institution_name=HSBC9 &institution_search_query=h10 &mfa_type11 &view_name=ERROR12 &request_id13 &link_session_id=821f45a8-854a-4dbb-8e5f-73f75350e7e714 ×tamp=2018-10-05T15%3A22%3A50.542ZOAuth
Using Plaid Link with an OAuth flow requires some additional setup instructions. For details, see the OAuth Guide.
Supported platforms
Plaid officially supports WKWebView on iOS 10 or later and Chrome WebView on Android 4.4 or later.