BrandKwikID Documentation
Video Flow

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

Android Studio Logo

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:

  1. ACCESS_NETWORK_STATE - Monitor network connectivity
  2. INTERNET - Enable network communication
  3. CAMERA - Access device camera for video verification
  4. LOCATION - Location-based verification features
  5. 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.IpvHelper

Step 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

CodeDescription
200Verification was successful
400Verification failed
422Invalid input
401Authentication failed
500Internet Connection problem / generic
501Camera/Microphone permission issue
502User exited the process
503Agent abandoned
410Link 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 **.*$JavaScriptInterface

Retrofit 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

iOS Swift Logo

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:

  1. KwikIDInterface.swift - The actual KwikID SDK implementation code
  2. SceneDelegate.swift - Standard scene delegate file for a new app
  3. AppDelegate.swift - Standard app delegate for a new app
  4. Info.plist - Standard info.plist configuration
  5. ViewController.swift - A sample view controller with SDK integration

Prerequisites

Ensure the following requirements are met:

  1. Internet Access - The app must have internet connectivity
  2. Camera Permission - Access to device camera for video verification
  3. Microphone Permission - Audio recording capabilities
  4. 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 configuration

Step 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 CodeDescription
422Incorrect SDK input parameters
401Authentication failed (invalid credentials)
400KYC/VPD rejected
200KYC/VPD approved
502Customer 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: uat or production
  • 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
  • allow="camera; microphone; geolocation": Required for video, audio, and location features
  • Consider adding fullscreen if 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

Next Steps