Adding the SDK to your project

To add our SDK to your own application, you should add it to the build process of your application. Currently we only support doing this using Gradle.
Adding the SDK to your gradle build file consist of two steps:

Adding the repository

To add the repository to your project, open the settings.gradle file in your application.
Edit the repositories part of your settings.gradle, so that it contains the following:

maven {
    credentials {
        username 'ExampleUsername'
        password 'ExamplePassword'
    url ""
maven { url "" }

We add because some of our dependencies are hosted there. If your settings.gradle already contains, don't add it.
The full repositories section of your settings.gradle might look like this now:

dependencyResolutionManagement {
    repositories {
        maven {
            credentials {
                username 'ExampleUsername'
                password 'ExamplePassword'
            url ""
        maven { url "" }

Adding the dependency

Edit the dependencies part of your build.gradle, so that it contains the following:

implementation 'com.klippa:identity_verification:0.7.5'

The full dependencies section of your build.gradle might look like this now:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.klippa:identity_verification:0.7.5'

When you build your app now, it should download our library as dependency, and with that all dependencies of our library.

Creating sessions

Before you can start using the identity verification you need to generate a session token in your backend. You can then start the session using your newly generated token. Once the session has been completed you can collect the files and data read by the OCR.

Starting the identity verification

To start the identity verification, import our package:

// Add to the top of your file
import com.klippa.identity_verification.modules.base.IdentitySession;
// Add to the top of your file
import com.klippa.identity_verification.modules.base.IdentitySession

Then start the session from your own Activity

public class MainActivity extends AppCompatActivity {

    public void onCreate(@Nullable Bundle savedInstanceState) {

        // @todo: get a session token from the API through your backend here.
        IdentitySession identitySession = new IdentitySession("{your-session-token}");

        yourButton.setOnClickListener(buttonView ->


    private final ActivityResultLauncher startIdentitySession = registerForActivityResult(new StartIdentitySession(),
        sessionResultCode -> {
            // switch over the `sessionResultCode` and handle accordingly.

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {

        // @todo: get a session token from the API through your backend here.
        val identitySession = IdentitySession("{your-session-token}")

        yourButton.setOnClickListener {

    private val startIdentitySession = registerForActivityResult(StartIdentitySession()) { sessionCode ->
        // switch over the `sessionCode` and handle accordingly.

Session Codes

When the SDK is finished it will return a IdentitySessionResultCode. The current session codes are:

Note: It's also possible to get a message from each IdentitySessionResultCode by calling message() on the sessionCode


Customizing the session

The SDK has a few customizing settings, the following methods are available:


Add or edit the file android/app/src/main/res/values/colors.xml, add the following:

<color name="kiv_text_color">#FF0000</color>
<color name="kiv_background_color">#000000</color>
<color name="kiv_button_success_color">#4CAF50</color>
<color name="kiv_accent_color">#E91E63</color>
<color name="kiv_button_error_color">#673AB7</color>
<color name="kiv_button_other_color">#333333</color>
<color name="kiv_progress_bar_background_color">#00FFFF</color>
<color name="kiv_progress_bar_foreground_color">#9C27B0</color>
<color name="kiv_camera_success_background_color">#BBAC27</color>


You can also replace the fonts by adding the files:



We currently support English, Dutch, German, French and Spanish.
Note: It's currently not possible to change the strings.

identitySession.language = IdentityBuilder.KIVLanguage.English;
identitySession.language = IdentityBuilder.KIVLanguage.English

Retry Threshold

To configure how often a user can attempt a task before the contact support button is shown to the user.

identitySession.retryThreshold = 1;
identitySession.retryThreshold = 1

Intro/Success screens

To configure whether to show intro/success screens, add the following to the session:

identitySession.hasIntroScreen = true;
identitySession.hasSuccessScreen = true;
identitySession.hasIntroScreen = true
identitySession.hasSuccessScreen = true

Auto capture

The ability to automatically take a photo of the document when it passes all checks.

identitySession.enableAutoCapture = true;
identitySession.enableAutoCapture = true

Include & Exclude lists

You can edit the include list: the extracted data keys that will be shown to the user after document pictures are processed. Or the exclude list: the extracted data keys that will be hidden for the user after document pictures are processed.

// Default value:
List<String> includeList = new ArrayList<>(Arrays.asList(
identitySession.includeList = includeList;

// Default value (empty):
identitySession.excludeList = new ArrayList<>();
// Default value:
identitySession.includeList = mutableListOf(

// Default value (empty):
identitySession.excludeList = mutableListOf()

Validation Include & Exclude lists

You can edit the validation include list: the failed validations that are shown to the user. Or the validation exclude list: the failed validations that are hidden from the user.
For more information regarding validations check out the API documentation.

// Default value:
List<String> validationIncludeList = new ArrayList<>(Arrays.asList(
identitySession.kivValidationIncludeList = validationIncludeList;

// Default value (empty):
identitySession.kivValidationExcludeList = new ArrayList<>();
identitySession.kivValidationIncludeList = listOf(

// Default value (empty):
identitySession.kivValidationExcludeList = mutableListOf()

APK size / APK splitting

Because our SDK includes OpenCV, which includes native code which in turn generates a native library (.so file) for every architecture, the APK size can increase quite a bit by using our SDK.
To minimize the impact of the SDK on your app size, you can enable APK splitting in your build.grade, like this:

android {
    // Other options
    splits {
       abi {
           enable true
           universalApk false
           include 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
    // Other options

In our example app (which contains not much more than the SDK), this resulted in the following APK files:

  • arm64-v8a.apk: 28MB
  • armeabi-v7a.apk: 15.2MB
  • x86_64.apk: 29.1MB
  • x86.apk: 28.4MB

While creating a single APK file creates a file that is 100.8MB, since most phones are ARM, on average APK splitting will result in a 45MB smaller APK, in those cases the SDK will add between 47-61MB to the APK size.

Please note that all APK files should be signed and uploaded to the Play Store to get a release that works on all devices.


The JavaDoc of the latest version is available for download here.


The following versions are available:

Version Gradle dependency JavaDoc
0.7.5 implementation 'com.klippa:identity_verification:0.7.5' Download
0.7.4 implementation 'com.klippa:identity_verification:0.7.4' Download
0.7.3 implementation 'com.klippa:identity_verification:0.7.3' Download
0.7.2 implementation 'com.klippa:identity_verification:0.7.2' Download
0.7.1 implementation 'com.klippa:identity_verification:0.7.1' Download
0.7.0 implementation 'com.klippa:identity_verification:0.7.0' Download
0.6.9 implementation 'com.klippa:identity_verification:0.6.9' Download
0.6.8 implementation 'com.klippa:identity_verification:0.6.8' Download
0.6.7 implementation 'com.klippa:identity_verification:0.6.7' Download
0.6.6 implementation 'com.klippa:identity_verification:0.6.6' Download
0.6.5 implementation 'com.klippa:identity_verification:0.6.5' Download
0.6.4 implementation 'com.klippa:identity_verification:0.6.4' Download
0.6.3 implementation 'com.klippa:identity_verification:0.6.3' Download
0.6.2 implementation 'com.klippa:identity_verification:0.6.2' Download
0.6.1 implementation 'com.klippa:identity_verification:0.6.1' Download
0.6.0 implementation 'com.klippa:identity_verification:0.6.0' Download
0.5.2 implementation 'com.klippa:identity_verification:0.5.2' Download
0.5.1 implementation 'com.klippa:identity_verification:0.5.1' Download
0.5.0 implementation 'com.klippa:identity_verification:0.5.0' Download
0.4.0 implementation 'com.klippa:identity_verification:0.4.0' Download
0.3.0 implementation 'com.klippa:identity_verification:0.3.0' Download
0.2.2 implementation 'com.klippa:identity_verification:0.2.2' Download
0.2.1 implementation 'com.klippa:identity_verification:0.2.1' Download
0.2.0 implementation 'com.klippa:identity_verification:0.2.0' Download
0.1.0 implementation 'com.klippa:identity_verification:0.1.0' Download
0.0.16 implementation 'com.klippa:identity_verification:0.0.16' Download



  • Added support for up to 4 liveness tasks.
  • Added image to intro if document_type in FieldValidation was setup when creating a session.
  • Added ability to detect document type and show warning if incorrect document type is shown.
  • Added French and German translations.
  • Changed autoCapture photo taking indication; now just the border changes color.


  • Added new loading animation which tint can be set using kiv_accent_color.
  • Added new IdentitySessionResultCode: INCORRECT_SESSION_SETUP which will be used when the session was configured incorrectly.
  • Added ability automatically take a photo of identity document, this can be enabled using enableAutoCapture on IdentitySession.
  • Added kivValidationIncludeList and kivValidationExcludeList which can be used to include/exclude validations.
  • Fixed issue where MrzChecksumValidation was not being handled correctly.
  • Fixed issue where progress bar did not show in intro screen.
  • Improved identity document detection model.
  • Improved liveliness detection on liveness tasks.


  • Added support for AllowPictureFallback which can be configured when creating a session token.
  • Fixed issue where camera might remain active after taking photos.


  • Improved internal logging.


  • Added tooltip to manual MRZ input button. The tooltip pops up after 10 seconds of unsuccessful attempts of MRZ scanning.
  • Fixed issue where view rotation could return null.


  • IdentityBuilder has been renamed to IdentitySession.
  • IdentitySession must be initialized using a session token.
  • Added StartIdentitySession() contract which will now be used for starting the session.
  • Added IdentitySessionResultCode which returns the result of the IdentitySession
  • Removed IdentityBuilderListener in favor of StartIdentitySession().
  • StartIdentitySession() returns IdentitySessionResultCode enum.
  • Removed KlippaError in favor of IdentitySessionResultCode.
  • Increased MRZ scanning speed.
  • Fixed issue where SDK would crash when moved to background and garbage collected. (SDK now reevaluates the session and handles it accordingly)
  • Fixed issue where some buttons could be spammed causing unexpected SDK states.
  • Removed ability to set colors + fonts on IdentityBuilder please use resources instead (see Customizing the identity verification).
  • Fixed issue where try again button on NFC result screen gave unexpected behavior.


  • Fixed issue where NFC authentication could fail with some identity documents.


  • Added support for data groups 11 and 12.


  • Fixed issue where dependencies could cause unexpected conflicts.


  • Fixed issue where button on NFC intro screen was formatted incorrectly.
  • Added contactSupportButton to NFC screen which is shown after x attempts, the threshold of this can be set with retryThreshold on IdentityBuilder (default is 3). When this button is tapped identityVerificationContactSupportPressed() is called and the session is ended.
  • Added ability to skip backside of passport is detected, which can be enabled by setting SkipPassportBackPicture in the session configuration.


  • Temporarily disabled ID model detection.


  • Added ability to add MRZ manually instead of using MRZ scanner.
  • Added model to detect ID for assistance when taking photo of ID.
  • Fixed issue where NFC PACE authentication always failed.


  • Updated masterList
  • Fixed issue where NFC PACE authentication failure was not being handled correctly.


  • Fixed issue where camera could fail to load after configuration changes.
  • Fixed issue where some classes where being de-initialized too early.
  • Fixed issue where continue button could be dismissed unintentionally.


  • Added touch to focus to MRZ scanner.
  • Increased scanning resolution on MRZ scanner.
  • Decreased MRZ scanner view finder size for improved detection.
  • Decreased scanning times on MRZ scanner.
  • Fixed issue where MRZ scanner stop unexpectedly with some passports.
  • Fixed issue where some errors were not parsed correctly.


  • NFC is no longer required in the AndroidManifest.
  • Added DeviceDoesNotSupportNFC to KlippaError which is returned when NFC is required but the device does support not it.
  • Added DeviceNFCDisabled to KlippaError which is returned when NFC is required but is disabled on the device.


  • Multiple validation errors can now be shown if necessary.


  • Added ability to disable Liveness detection by setting RequiredLivenessCount to 0.
  • Fixed issue where some colors were not being set correctly.
  • Fixed issue where bold font was not being set correctly.
  • Fixed issue where NFC could fail during authentication.


  • Added NFC Support. This can be enabled through the API by setting RequiredNFCScanCount to 1.
  • Fixed issue where ProGuard might remove used classes.
  • User is now prompted if environment is too dark/bright.
  • Decreased size of Liveness detection models.


  • Added Active and Passive Liveness detection during the selfie step, users will now have to complete 2 tasks (tilting their head in x direction) before the selfie is automatically taken.
  • Renamed finished() to identityVerificationFinished().
  • Renamed canceled() to identityVerificationCanceled(withError:).
  • Renamed contactSupportPressed to identityVerificationContactSupportPressed().


  • The RequiredFields option now enforces that fields are filled. A session cannot be completed successfully if one of the required fields is missing.
  • Increased quality of pictures taken.


  • Fixed issue where permission request could sometimes hide behind activity.
  • Changed kiv_no_camera_permission to always appear if no permission to camera was granted. (Before it only showed for 3.5 seconds)


  • Fixed issue where we no longer require parent app to request camera permissions and if necessary actively ask for permission.


  • Now uses production API by default (unless you’re making a test/debug build builder.isDebug = true). Please note that due to this change you will have also have to call the production API ( from your backend.


  • Adjusted document and selfie screen UI
  • Added callback for support button pressed contactSupportPressed()
  • Added ability to include/exclude data from data verification check screen with builder.includeList and builder.excludeList


  • Fix timeout handling
  • Fix Spanish error string


  • Minor translation improvements
  • Fix Identity Document file display


  • Fix activity not finishing with correct state.
  • Add Spanish as language
  • Change some English string values
  • Finish Dutch translation


  • Fix annotations not being loaded correctly breaking API usage.


  • Allow colors to be properly overwritten.


  • Fix a bug in Gradle that prevented our resources from being included.


  • Add getIntent method to be able to start the activity yourself. Don’t force usage of the listener.


  • Update minification to always include our own package name.


  • Initial version