KYCInsight SDK
NetApps KYC Insight SDK is a powerful tool designed to simplify Know Your Customer (KYC) processes for businesses. It provides a seamless integration of KYC verification directly into web applications, ensuring compliance with regulatory requirements while enhancing user experience.
To start using the NetApps KYCInsight SDK, follow these steps:
-
Installation
- Include the NetApps KYCInsight SDK script in your HTML file:
<script src="https://kyc-verify.netapps.ng/kyc/netappskyc.js" type="text/javascript"> -
Initialization
- Create a function to trigger the KYC verification process, and within it, initialize the SDK with the required parameters:
function kyc() { const data = { "slug": "kyc_marketplace", "public_key": "NA_PUB_PROD-b97fef4c1181d9eef7720368287f9d6c", "name": "Nwoko Ndubueze Lawrence", "userRef": "16", // this will be used to identify your customer across our system "levelSlug": "tier_3" } const service = new InitNetAppsKyc(data.public_key,data.slug,data.userRef,data.name, data.levelSlug); // Trigger KYC verification service.kyc({ displayInKycError: true, displayKycButtonOnVerification: false, onReady: () => { console.log("Ready") }, onSuccess: (msg) => { console.log(msg) // Perform additional actions upon successful KYC verification retrieveKycDetails(data.userRef, data.slug); }, onFailed: (error) => { console.log(error, "onError") }, }); // Close the service service.close(); } -
Triggering KYC Verification:
- Call the
kyc()function to initiate the KYC verification process. You can associate this function with a button click or any other event in your web application.
- Call the
-
Handling Success Callback:
- Upon successful KYC verification, retrieve the KYC details of the user by sending a GET request to the specified endpoint:
curl --location --request GET 'https://kyc-api.netapps.ng/api/v1/user/[email protected]&slug=test_4' \ --header 'x-secret-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \ --data-raw '{ "userRef":"16", "slug":"tier_3" }'
Request Parameters:
userRef: The user reference of the customer.slug: The slug of the business.
Headers
x-secret-key: The secret key of the business.
Sample Response:
{
"message": "Kyc details successfully retrieved",
"error": false,
"data": {
"userRef": "16",
"name": "Nwoko Ndubueze Lawrence",
"status": false,
"level": 1,
"levels": [
{
"level": 1,
"levelName": "tier 1",
"levelSlug": "tier_1",
"status": false,
"kyc": [
{
"name": "gender",
"status": false,
"query": {
"gender": "male"
},
"result": {},
"createdAt": "26-02-2024 10:59:09",
"updatedAt": "26-02-2024 10:59:09"
}
]
}
]
}
}
Technical Example:
Suppose you have a web application where users need to complete KYC verification before accessing certain features. Here's how you can integrate the NetApps KYCInsight SDK:
-
Frontend Integration:
- Add a button to trigger the KYC verification process:
<button onclick="kyc()">Verify KYC</button>- Implement the
kyc()function to initialize the KYC service and trigger verification.
-
Backend Integration:
- Upon successful KYC verification (in the
onSuccesscallback), make a backend API call to retrieve the user's KYC details using the provided endpoint. - Parse the response and utilize the KYC data as required within your application.
- Example backend code (Node.js using Axios)
const axios = require('axios'); function retrieveKycDetails(userRef, slug) { const secretKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; const apiUrl = `https://kyc-api.netapps.ng/api/v1/user/kyc?userRef=${userRef}&slug=${slug}`; axios.get(apiUrl, { headers: { 'x-secret-key': secretKey } }) .then(response => { console.log(response.data); // Process KYC details here }) .catch(error => { console.error(error); }); } - Upon successful KYC verification (in the
Conclusion
NetApps KYCInsight SDK offers a streamlined solution for integrating KYC verification seamlessly into web applications. By following the provided documentation and technical example, developers can easily implement KYC processes and enhance compliance with regulatory standards.
Updated over 1 year ago
