Client-side Rendering
Before you do Anything
Please Sign Up to get started here - https://app.creditchek.africa/auth/signup
The first thing you need to do is to go to the B2B portal at https://app.creditchek.africa/auth/signup to create an account with CreditChek. After signing up, follow the process required to verify your account on the app using the verification code sent to you email used for account creation. After this is done, you can then login.
Customize your SDK
Available Libraries/SDK
- VANILLA JAVASCRIPT
Using the sample script below, you can also implement our javascript SDK into your project.
- Insert the HTML code
Custom Button
<button id="open_creditchek">Trigger CreditChek Widget</button>
::: The HTML is scanned for button elements that have a open_CreditChek ID, and this is where the secure widget can be triggered :::
- Insert the JavaScript tag just before your closing body tag
Insert Script in head tag
<script src="https://securedwidget.creditchek.africa/widget.js" async ></script>
- Include the following JavaScript code configurations either in your HTML file or in a seperate JS file
Configure your widget
var config = {
businessId: "YOUR_BUSINESS_ID",
key: 'YOUR_PUBLIC_KEY',
customerName: 'YOUR_CUSTOMER_NAME',
loanAmount: 'ENTER_LOAN_AMOUNT',
loanId: "REQUEST_LOAN_ID"
appId: 'YOUR_APP_ID',
onClose: () => {
// what happens when the widget closes
console.log("This widget was closed")
},
onComplete: (data) => {
console.log(data)
// action when the widget has shown results
}
}
const connect = new Connect(config);
const button = document.querySelector('#open_creditchek');
button.addEventListener('click', function () {
connect.open();
});
Configurations
Name | Required | Description |
---|---|---|
key | True | This is your public key and can be found in the App section of the CreditChek portal |
businessId | True | This is your Business ID and can be found in the top right corner after logging in to the CreditChek portal |
customerName | False | The name of your customer who wants to run the insights |
loanAmount | False | An optional parameter that takes the loan amount the your customer wants to request |
loanId | True | This is the request ID for your loan request that will be tied to a webhook response |
appId | True | This is the ID of the app you would like to connect for your secure widget operations. It can be found on the app section of the dashboard. |