Usage

Introduction

This SDK will help you to build a verification process for your project, the goal is to build easy steps which you can run and get the result to your system or in your application. This is the main part SDK's that contains the verification process launcher and common steps.

The whole process goes step by step. On each step where data is obtained it is forwarded to our server or one that you provided. The process will stop if any step returns a critical error.

It is built as Kotlin DSL.

Configuration

Before launch SDK must be configured

val config = elkycConfig {
    customFlow = steps
    clientKey = "clientKey"
    appKey = "appKey"
    workplace = workplaceConfig
}
  • customFlow - sequence of steps that the verification process consist of (required)

  • clientKey - client key (required)

  • appKey - application key (required)

  • workplace - parameters of workplace (optional)

workplaceConfig = WorkplaceConfig(
        host = "https://workplace.com",
        authPath = "/api/sdk/auth/signIn",
        mainPath = "/api/sdk/workplace/verification",
        encryptData = false,
        rssigSalt = "salt",
        accessToken = "accessToken",
        clientSession = "clientSession"
    )
  • host - HTTPS Host to which the data you want to be sent (optional, by default data won't be sent)

  • authPath - path for the sign in request (optional)

  • mainPath - path that is used for sending the data (optional)

  • encryptData - specifies if the data should be encrypted (optional, by default false)

  • rssigSalt - is used for response signature validation (optional, by default signature is not being validated)

  • accessToken - will be added to each request as Bearer authentication (optional)

  • clientSession - will be added as header x-client-session to each request (optional)

Launch

Elkyc.startVerification(
    activity = requireActivity(),
    config = config,
    resultLauncher = resultLauncher,
    printLog = true,
    callback = { data: ConclusionData -> }
)
  • activity - your activity that is used to start SDK

  • config - configuration that you have made in previous point

  • resultLauncher - see example below

  • printLog - use it to print log (optional, by default false)

  • callback - block where you will receive a resulting data of document scanning, liveness and matching (optional)

Example of Result launcher:

private val resultLauncher =
    registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
        when (it.resultCode) {
            Activity.RESULT_OK -> Log.i("RESULT", "FINISHED SUCCESSFULLY")
            Activity.RESULT_CANCELED -> {
                Log.e("RESULT", it.data?.getStringExtra(EXTRA_ERROR_RESULT) ?: "ERROR without message")
            }
        }
    }

Last updated