vConnect 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 vConnect.
Include this script tag:
<script src="https://cdn.ribbit.ai/widgets/v4/ribbit-connect.min.js"></script>
Then initialize vConnect 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 vConnect | |
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 | vConnect defaults to displaying as a vertical, mobile-sized floating element |
inline | boolean | false | Whether or not vConnect should display inline (default is popup) |
settings | object | Additional settings (see below) |
* required
Name | Type | Default | Description |
---|---|---|---|
resize | boolean | false | If resize=true, vConnect 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 vConnect, allowing the user to directly initiate the CONNECT.close() method and the "exit" event |
mobileWidth | int | 650 | If the width of the vConnect target element is reduced below this count of display pixels, vConnect will switch to fullscreen for a seamless mobile experience |
canOpenNewWindows | boolean | true | Whether or not the vConnect 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 vConnect.{ "sessionToken": "vConnect Session Token", "eventDate": "2022-01-01T12:00:00.0000000Z", "eventName": "complete", "customerId": "Customer or Reference ID", "merchantId": 12345, "connectComplete": true, "connectType": "BankLOGIN", "inquiryId": "vInsights 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="vConnect"></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>