Skip to main content

Android SDK

Drop-in Android library for the WIDTH verification flow. ActivityResult-based entry, themeable, no ProGuard rules required.

Requirements

RequirementMinimum
Android API24 (Android 7.0)+
Kotlin1.9+
AGP8.0+
Gradle8.0+
Jetpack ComposeBundled transitively

Integration

1. Extract the SDK

Unzip widthsdk-<version>.zip into your project (for example app/libs/widthsdk/).

2. Register the local Maven repository

// settings.gradle.kts
dependencyResolutionManagement {
  repositories {
    maven { url = uri("./app/libs/widthsdk/m2") }
    google()
    mavenCentral()
  }
}

3. Add the dependency

// build.gradle.kts
dependencies {
  implementation("com.width.identity:sdk-activity:1.0.0")
}

Start verification

Register an ActivityResult launcher:

import com.width.identity.activity.*

class MainActivity : AppCompatActivity() {

  private val verificationLauncher =
    registerForActivityResult(Verification()) { result ->
      when (result) {
        is VerificationResult.Completed -> { /* executionId, decision */ }
        is VerificationResult.Waiting   -> { /* executionId */ }
        is VerificationResult.Failed    -> { /* code, message */ }
        is VerificationResult.Cancelled -> { /* user exited */ }
      }
    }
}

Launch with the credentials returned from your backend:

verificationLauncher.launch(
  VerificationInput(
    credentials = CredentialsConfig(
      appId    = "YOUR_APP_ID",
      apiKey   = "YOUR_API_KEY",
      domain   = "YOUR_DOMAIN",
      sdkToken = "YOUR_SDK_TOKEN",
    ),
    customer = CustomerConfig(
      customerId = "user-123",
      email      = "user@example.com",
    ),
    theme = ThemeConfig(themeMode = "SYSTEM"),
  )
)

Public API

SymbolPurpose
VerificationActivityResultContract entry
VerificationInput / CredentialsConfig / CustomerConfigLaunch inputs
VerificationResult / VerificationDecisionResult callback
ThemeConfigOptional theme override

Permissions

Merged into your manifest automatically:

The SDK handles the runtime CAMERA permission request internally.

Log forwarding (optional)

import com.width.identity.activity.SdkLogLevel
import com.width.identity.activity.SdkLogging

SdkLogging.setLogger { level, tag, message, throwable ->
  // level is INFO, WARN, or ERROR
}

Notes

Support. For integration questions, contact long@width.com.