SDK Integrations
Complete guide for integrating KwikID SDKs across different platforms
Overview
KwikID provides native SDKs for seamless integration across multiple platforms, enabling secure video-based identity verification and KYC processes. Our SDKs are designed to be lightweight, secure, and easy to integrate.
Key Features
- Native Performance: Optimized for each platform with minimal overhead
- Secure Communication: End-to-end encrypted data transmission
- Real-time Processing: Live video verification with AI-powered analysis
- Cross-platform Support: Android, iOS, and Web SDKs available
- Easy Integration: Simple setup with comprehensive documentation
1. Android SDK Integration
The KwikID Android SDK provides native integration for Android applications, enabling seamless video-based identity verification with minimal setup.
Android SDK Integration Flow
Initial Setup
Step 1: Add Repositories
Add the following repositories to your build.gradle or settings.gradle (for latest Android projects) file:
maven {
url "https://artifacts.thinkanalytics.in/artifactory/kwikid/"
allowInsecureProtocol = true
credentials {
username = "<maven_u>"
password = "<maven_p>"
}
}Step 2: Include Dependency
Include the IPV Android library dependency into your app's app level build.gradle file by adding the following line to the dependencies block:
implementation 'in.thinkanalytics.kwikid:native_sdk:<Latest-version>'Step 3: Clean and Build
Clean and build the project once to ensure that the library has been included properly.
Required Permissions
The Android SDK requires the following permissions in your AndroidManifest.xml:
- ACCESS_NETWORK_STATE - Monitor network connectivity
- INTERNET - Enable network communication
- CAMERA - Access device camera for video verification
- LOCATION - Location-based verification features
- AUDIO - Audio recording capabilities
Android Implementation
Step 1: Import Statement
Import the following in the Activity that'll start the process:
import com.getkwikid.kwikid_sdk.Helpers.IpvHelperStep 2: SDK Initialization
Initialize User SDK as follows:
IpvHelper.getInstance().startIpv(this, data.toString())Where data is an object of type JSONObject with the required structure for SDK configuration.
Step 3: Handle Activity Results
Override onActivityResult() method along the following lines:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 55) { // replace 55 with the request code passed while calling startActivityForResult
if (resultCode == IpvHelper.getInstance().getResultCode()) {
JSONObject result = new JSONObject(data.getStringExtra("data"));
// Handle the result
}
}
}Where result object contains the SDK response with verification details.
Android Response Handling
The SDK returns a JSONObject with the following structure:
{
"user_id": "<String>",
"session_id": "<String>",
"extras": "<JSONObject> (optional)",
"status": "<Number>"
}Response Fields
- user_id: Unique identification number of each user
- session_id: Unique session identifier
- extras: Additional information regarding the session (optional)
- status: Verification status code
Status Codes
| Code | Description |
|---|---|
| 200 | Verification was successful |
| 400 | Verification failed |
| 422 | Invalid input |
| 401 | Authentication failed |
| 500 | Internet Connection problem / generic |
| 501 | Camera/Microphone permission issue |
| 502 | User exited the process |
| 503 | Agent abandoned |
| 410 | Link Expired |
Android ProGuard Configuration
Add the following ProGuard rules to prevent code obfuscation issues:
WebView and JavaScript Interface Rules
-keepattributes SetJavaScriptEnabled
-keepattributes JavascriptInterface
-keepclassmembers class * { @android.webkit.JavascriptInterface <methods>; }
-keepclassmembers class **.*$WebAppInterface { *; }
-keep public class **.*$WebAppInterface
-keep public class **.*$JavaScriptInterfaceRetrofit and Network Libraries
# Retrofit
-keep class com.google.gson.** { *; }
-keep public class com.google.gson.** {public private protected *;}
-keep class com.google.inject.** { *; }
-keep class org.apache.http.** { *; }
-keep class org.apache.james.mime4j.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.xml.stream.** { *; }
-keep class com.google.appengine.** { *; }EventBus Rules
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# Only required if you use AsyncExecutor
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}2. iOS SDK Integration
The KwikID iOS SDK provides native integration for iOS applications using WebView technology, enabling seamless video-based identity verification with real-time updates.
iOS SDK Integration Flow
SDK Components
The iOS SDK integration contains the following files:
- KwikIDInterface.swift - The actual KwikID SDK implementation code
- SceneDelegate.swift - Standard scene delegate file for a new app
- AppDelegate.swift - Standard app delegate for a new app
- Info.plist - Standard info.plist configuration
- ViewController.swift - A sample view controller with SDK integration
Prerequisites
Ensure the following requirements are met:
- Internet Access - The app must have internet connectivity
- Camera Permission - Access to device camera for video verification
- Microphone Permission - Audio recording capabilities
- Location Permission - Location-based verification features
iOS Implementation
Step 1: Initialize SDK Object
let kwikidvc = KwikIDInterface()Step 2: Set SDK Variables
Configure the SDK with your client credentials and parameters:
kwikidvc.client_id = "RBL_uat"
// Add other required parameters as per your configurationStep 3: Register Callbacks
Set up callback handlers for actionable events during the customer journey:
// Initialize callback
kwikidvc.onInit = { result in
// Handle initialization result
}
// Session completion callback
kwikidvc.onSessionComplete = { result in
// Handle session completion
// Monitor kwikidvc.result_obj.status for session status
}Step 4: Initiate VKYC Process
Start the verification process:
kwikidvc.initiateVKYC()Step 5: Monitor Session Status
Monitor the kwikidvc.result_obj.status for session status updates:
| Status Code | Description |
|---|---|
| 422 | Incorrect SDK input parameters |
| 401 | Authentication failed (invalid credentials) |
| 400 | KYC/VPD rejected |
| 200 | KYC/VPD approved |
| 502 | Customer exited the process |
Sample Implementation
Refer to the initiateVkyc function in ViewController.swift for a complete sample implementation.
Download Sample Project
Download the complete sample project with iOS SDK integration:
Download iOS SDK Sample Project
iOS Benefits
- WebView Technology: Deploy changes on-the-fly without app updates
- Real-time Updates: Instant deployment of portal changes
- Native Performance: Optimized for iOS platform
- Comprehensive Callbacks: Detailed event handling for better user experience
- Easy Integration: Simple setup with sample code provided
3. Web SDK Integration
Overview
Embed the KwikID portal securely via an iframe. Use the minimal parameter set and grant the required browser permissions for camera, microphone, and geolocation.
Minimal Integration
<iframe
allow="camera; microphone; geolocation"
src="https://<user-portal-static-link>/?client_id=<client_id>&api_key=<api_key>&user_id=<user_id>&environment=production&l=<link_id>&s=0"
height="750"
width="500"
></iframe>Parameters
- client_id: Your issued client identifier (example:
LoanBaba_prod) - api_key: Your issued API key (example:
LoanBaba_prod) - user_id: Unique user identifier or mobile number
- environment:
uatorproduction - l: Link ID generated via Send Link
- s: Scheduling mode
0- Free mode (user joins queue; random agent assigned)1- Schedule mode (calendar allows selecting a future slot)
Optional fields you may include when available:
- user_name: User’s name
- user_gender: User’s gender
- user_dob: User’s date of birth
- user_fathername: User’s father’s name
Recommended Permissions
- allow="camera; microphone; geolocation": Required for video, audio, and location features
- Consider adding
fullscreenif you enable maximized view in your UI
Responsive Recommendation
- On mobile devices, set iframe width/height to 100% of the viewport for best UX.
Benefits
- Seamless Integration: Quick setup with minimal code changes
- Platform Optimized: Native performance on each platform
- Secure by Design: End-to-end encryption and secure data handling
- Comprehensive Error Handling: Detailed status codes for better debugging
- ProGuard Compatible: Full obfuscation support with proper configuration