Skip to main content

Android SDK

Same dashboard and API as the web SDKs. The Android SDK collects device signals with a public key and returns an eventId. Your backend verifies with a secret key.

Requirements

  • Min SDK 21, Target SDK 36
  • Kotlin 1.9+ (Java 11 bytecode)
  • Internet access on device

Install

Maven Central:
Private GitHub Packages publishing is also supported for internal builds — use the same com.keverd:fraud-sdk coordinates when configured.

API keys

Use a public key only (kv_pk_test_… / kv_pk_live_…).
Never put a secret key (kv_sk_…) in the Android app. Secret keys are for server verify only.
Get keys at dashboard.keverd.comIntegrate → API keys. See API keys.

Permissions

Merged from the library manifest:

Initialize

Call once — typically in Application.onCreate:

Config

When consentRequired = true (default):
Without consent, getVisitorData() fails with KeverdError.Code.CONSENT_REQUIRED (or returns Result.ConsentRequired on the callback API).

Collect

Kotlin (suspend)

Callback (Java-friendly)

getVisitorData() calls POST /v2/fingerprint with header X-API-Key (and X-SDK-Source: android).

Response (VisitorData)

Send the event id to your backend:
Your server then calls POST /v2/verify with { "event_id": "…" } using a secret key. See Server SDKs.
There is no separate getVisitorId() API. Use VisitorData.visitorId after getVisitorData().

Login verification (collect with login context)

Attaches login context to the collect request (POST /fingerprint/verify/login). This still uses the public key and does not replace server verify().
LoginIdentifierHash.fromIdentifier(identifier) produces sha256:<hex> of the lowercased identifier (optional salt). Never send raw emails/phones as the hash input if your policy forbids it — hash client-side first.

LoginContext

Behavioral signals (optional)

Improve signal quality by attaching listeners on screens where users interact:

Preview signals (debug)

Useful in the sample app / debug builds. Do not use as a substitute for getVisitorData().

Errors

Suspend APIs throw KeverdError. The callback API returns Result.Error(KeverdError).

ProGuard / R8

The published AAR ships consumer ProGuard rules that keep the public SDK surface (Keverd, Config, VisitorData, Result*, KeverdError, Action, verify types, and API DTOs). Extra keep rules are usually unnecessary.

Deprecated API

KeverdFingerprint.init / submit(...) remains as a thin 1.0.x migration wrapper. Prefer:

End-to-end flow

  1. App calls Keverd.getVisitorData() with kv_pk_…
  2. App sends eventId to your backend
  3. Backend calls POST /v2/verify with kv_sk_… and { "event_id": "…" }
  4. Enforce returned action: allow | soft_challenge | hard_challenge | block
Optional: subscribe to webhooks after verify.

Next