Android SDK
Drop-in Android library for the WIDTH verification flow. ActivityResult-based entry, themeable, no ProGuard rules required.
Requirements
| Requirement | Minimum |
|---|---|
| Android API | 24 (Android 7.0)+ |
| Kotlin | 1.9+ |
| AGP | 8.0+ |
| Gradle | 8.0+ |
| Jetpack Compose | Bundled 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
| Symbol | Purpose |
|---|---|
Verification | ActivityResultContract entry |
VerificationInput / CredentialsConfig / CustomerConfig | Launch inputs |
VerificationResult / VerificationDecision | Result callback |
ThemeConfig | Optional theme override |
Permissions
Merged into your manifest automatically:
CAMERA— document capture and livenessINTERNET— API communicationACCESS_NETWORK_STATE— connectivity checks
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
- All non-façade SDK classes are annotated
@WidthSdkInternal. - No ProGuard rules needed; consumer rules ship in the AAR.
Support. For integration questions, contact long@width.com.