Building the SDK

Creating a CafSmartAuth SDK instance

In order to create a CafSmartAuth instance, you need to use the CafBuilder class. This class provides a set of methods to configure the SDK instance.

Builder Properties

Property
Type
Description
Required

mobileToken

String

Mobile token provided by the platform.

context

Context

Context of the application.

Builder Methods

Method
Type
Description
Required

setStage

CafStage

Defines the environment stage (e.g., PROD, BETA). Default is PROD.

setEmailUrl

String

Sets the email authentication URL. Must be HTTPS protocol.

setPhoneUrl

String

Sets the phone authentication URL. Must be HTTPS protocol.

setFaceAuthenticatorSettings

Sets the face liveness authentication settings.

Example

    private fun setupCafFaceLiveness() {
        smartAuth = CafSmartAuth.CafBuilder("myMFAToken", this)
            .setStage(CafStage.PROD)
            .setEmailUrl("myEmailUrl") // Not mandatory
            .setPhoneUrl("myPhoneUrl") // Not mandatory
            .setFaceAuthenticatorSettings(
                CafFaceAuthenticatorSettings(
                    "myFaceAuthToken",
                    false,
                    true,
                    CafFilterStyle.LINE_DRAWING
                )
            ).build()
    }

Last updated

Logo

2023 © Caf. - All rights reserved