CONNECT is initiated by calling our API
You will want to provide as much PII (personally identifiable information) as possible. The more information provided, the more accurately we are able to decision on the account
{ "token" : { "clientId" : "Your ValidiFI Client ID", "clientSecret" : "Your ValidiFI Client Secret" }, "customer" : { "customerId" : "The unique Customer ID from your system", "firstName" : "John", "lastName" : "Smith", "emailAddress" : "test@noemail.com", "phoneNumber" : "1112223333", "address" : { "addressLine1" : "123 Main St", "city" : "Oxford", "state" : "OH", "zip" : "12345" } }, "terms" : { "fullAmount" : 500, "amount" : 100, "loanTerms" : "biweekly_oblig" }, "settings" : { "webhookURL" : "https://your.webhook.url/api (optional)", "bankId" : "1234567", "transactionHistoryDays" : 93 }, "notificationType" : 0 }
{ "sessionToken" : "GUID", "customerId" : "GUID", "url" : "string", "expiration" : "datetime" }
notificationType
= 1 (Email) or 2 (SMS).
The API endpoint will return a sessionToken
. Pass this token to your front-end to initialize CONNECT.
Include this script tag:
<script src="https://cdn.ribbit.ai/widgets/v4/ribbit-connect.min.js"></script>
Then initialize CONNECT with the following init parameters:
const CONNECT = new RIBBITConnect({
target: 'ribbit-container',
token: session_token,
environment: 'Test',
// Add optional parameters here. See below
});
CONNECT.open();
Name | Type | Default | Description |
---|---|---|---|
target* | string | ID of the element within the <body> which will contain CONNECT | |
token* | string | Token recieved from /CONNECT/session/ endpoint | |
environment | string | Production | Declare as "Test" during integration to use the ValidiFI test environment. Remove or declare as "Production" when moving to production |
language | string | en | Wording and display language can be modified Contact ValidiFI Support to discuss customizations |
fullscreen | boolean | false | CONNECT defaults to displaying as a vertical, mobile-sized floating element |
inline | boolean | false | Whether or not CONNECT should display inline (default is popup) |
settings | object | Additional settings (see below) |
* required
Name | Type | Default | Description |
---|---|---|---|
resize | boolean | false | If resize=true, CONNECT resizes itself to fit its child content. Might be useful if inline=true |
closeButton | boolean | false | Display an "x" close button on the top right of CONNECT, allowing the user to directly initiate the CONNECT.close() method and the "exit" event |
mobileWidth | int | 650 | If the width of the CONNECT target element is reduced below this count of display pixels, CONNECT will switch to fullscreen for a seamless mobile experience |
canOpenNewWindows | boolean | true | Whether or not the CONNECT interface can manage opening new browser windows. Used to handle OAuth and if a user clicks on any links. If this is not handled, you must handle the onLinkOpen event. |
You can then capture events on the client side with the following:
CONNECT.onExit(eventData => { CONNECT.close(); }); CONNECT.onComplete(eventData => { console.log(eventData); });
onComplete()
CONNECT.onComplete = function(details) { console.log(details); // Put your code here to save the account token or verification data // Put code here to update your UI (green checkmark, displaying account details, etc.) }
webhookURL
field when initializing CONNECT.{ "sessionToken": "CONNECT Session Token", "eventDate": "2022-01-01T12:00:00.0000000Z", "eventName": "complete", "customerId": "Customer or Reference ID", "merchantId": 12345, "connectComplete": true, "connectType": "BankLOGIN", "inquiryId": "BankLOGIN+ InquiryID", "inquiryType": "BankLOGIN+", "account": { "bankId": 12345, "bankName": "Full Bank Name", "accountNickname": "Sample Checking Account", "accountType": "Checking", "accountToken": "00000000-xxxx-xxxx-xxxx-000000000000", "last4Digits": "1234" } }
{ "token" : { "clientId" : "Your ValidiFI Client ID", "clientSecret" : "Your ValidiFI Client Secret" }, "customer" : { "customerId" : "The unique Customer ID from your system", "firstName" : "John", "lastName" : "Smith", "emailAddress" : "test@noemail.com", "phoneNumber" : "1112223333", "address" : { "addressLine1" : "123 Main St", "city" : "Oxford", "state" : "OH", "zip" : "12345" } }, "terms" : { "fullAmount" : 500, "amount" : 100, "loanTerms" : "biweekly_oblig" }, "settings": { "webhookURL" : "https://your.webhook.url/api (optional)" }, "notificationType" : 0 }The result will bring back a
sessionToken
that should be passed to the front-end.
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> </head> <body> <div id="connect"></div> <script src="https://cfsclientcdn01.blob.core.windows.net/ widgets/v4/ribbit-connect.min.js"></script> <script> // initialize widget const CONNECT = new RIBBITConnect({ target: 'connect', // ID of HTML element token: token_from_API }); // open CONNECT CONNECT.open(); CONNECT.onBrowserLaunch(url => { // handle new tab (e.g. OAuth login) window.open(url); }); CONNECT.onComplete(eventData => { // save inquiry ID console.log(eventData) }); CONNECT.onExit(eventData => { CONNECT.close(); }); </script> </body> </html>