QoreID Web SDK
This guide provides information on how to integrate the QoreID SDK with your web application. With the QoreID SDK, you can more conveniently access QoreID services.
Note
With this release, customers can perform Collection services like VeriFind (digital address verification), Passport, Driver's License and other QoreID services. Workflow will be available in a future release.
Requirements
- QoreID web SDK can be used on ECMAScript 5 and above supported browsers. You can confirm your browser's version compatibility on caniuse.com.
Integration
The Web SDK can be integrated within seconds by adding these few lines of code to your website.
<script type="text/javascript" src="https://dashboard.qoreid.com/qoreid-sdk/qoreid.js"></script>
By adding the scripts to your website head you can use the qoreid-button
Element on your site.
<qoreid-button
id="QoreIDButton"
clientId="// YOUR_QOREID_CLIENT_ID"
flowId="// YOUR_QOREID_FLOW_ID"
productCode="// PRODUCT_CODE"
customerReference="// CUSTOMER_REFERENCE"
applicantData="// {APPLICANT_DATA_OBJECT}"
identityData="// {IDENITY_DATA_OBJECT}"
addressData="// {ADDRESS_DATA_OBJECT}"
ocrAcceptedDocuments="// OCR_ACCEPTED_DOCUMENT"
onQoreIDSdkSubmitted="// ON_SUBMIT_CALLBACK"
onQoreIDSdkError="// ON_ERROR_CALLBACK"
onQoreIDSdkClosed="// ON_CLOSE_CALLBACK"
></qoreid-button>
SDK Button Attribute Options
-
clientId
Your QoreID client ID (as obtained from your QoreID portal). -
flowId (optional)
ID of a workflow you have created on your QoreID Portal dashboard. -
ProductCode
Value representing a QoreID service product. See the list of available Product Code optionsWhere a
flowId
value is not specified then aproductCode
value is required. -
customerReference
A value to be used as an identifier for a customer who is the subject of this verification -
applicantData
Data about an individual who is the subject of a verification.<qoreid-button applicantData='{"firstname": "// APPLICANT_FIRSTNAME","middlename": "// APPLICANT_MIDDLENAME", "lastname": "// APPLICANT_LASTNAME", "gender": "// APPLICANT_GENDER", "dob": "// APPLICANT_DOB (YYYY-MM-DD)", "phone": "// APPLICANT_PHONE_NUMBER", "email": "// APPLICANT EMAIL"}'> </qoreid-button>
-
identityData
Details for identity verification<qoreid-button identityData='{"idType": "// IDENTITY_TYPE", "idNumber": "// IDENTITY_NUMBER"}'> </qoreid-button>
-
addressData
Details for address verification<qoreid-button addressData='{"address": "// ADDRESS", "city": "// CITY", "lgaName": "// LGA_NAME"}'> </qoreid-button>
-
ocrAcceptedDocuments
For an OCR id scan, list of documents to be considered is required. See the list of Accepted Documents<qoreid-button ocrAcceptedDocuments="DRIVERS_LICENSE_NGA, VOTERS_CARD_NGA, NIN_SLIP_NGA"> </qoreid-button>
-
hideButton
Trigger the web SDK element without its default button. This can be used when launching the SDK screen with a custom button or directly from code<qoreid-button hideButton='yes' </qoreid-button>
-
onQoreIDSdkSubmitted
Accepts a callback to be triggered when there is an onSubmitted event<qoreid-button onQoreIDSdkSubmitted="function(event){console.log(event)}"> </qoreid-button>
-
onQoreIDSdkError
Accepts a callback to be triggered when there is an onError event<qoreid-button onQoreIDSdkSubmitted="function(event){console.log(event)}"> </qoreid-button>
- onQoreIDSdkClosed
Accepts a callback to be triggered when there is an onClosed event
<qoreid-button onQoreIDSdkSubmitted="function(event){console.log(event)}"> </qoreid-button>
- onQoreIDSdkClosed
Alternative callback events
The following script can be used to handle triggered event on the qoreid-button
element.
const button = document.getElementById("QoreIDButton");
// setup callbacks
button.addEventListener('qoreid:verificationSubmitted', ({ detail }) => {
console.log('submitted payload', detail)
});
button.addEventListener('qoreid:verificationError', ({ detail }) => {
console.log('error payload', detail)
});
button.addEventListener('qoreid:verificationClosed', ({ detail }) => {
console.log('closed payload', detail)
});
Updated over 1 year ago