Skip to main content
The 0xkey Kotlin SDK is a Kotlin / Android SDK for embedded wallets. Current version: v0.1.1.
  • Android minSdk 28, compileSdk 36; Kotlin coroutines and StateFlow
  • All modules share one version
  • Same wire format, stamps and HPKE parameters as the JS and Swift SDKs, so they can be used side by side on one organization
Most apps only need sdk-kotlin.

Install

The SDK is published on JitPack; no credentials are needed. In settings.gradle.kts:
In app/build.gradle.kts (the version is the Git tag):
Other modules follow the same pattern, for example com.github.0xkey-io.sdk-kotlin:crypto:v0.1.1. The same modules are also on GitHub Packages as io.0xkey:<module>:0.1.1, which requires a GitHub token with read:packages; use one source per build.

App setup

  • Passkeys need Digital Asset Links at https://<rpId>/.well-known/assetlinks.json with the delegate_permission/common.get_login_creds relation and the SHA-256 fingerprints of every certificate that signs the app (debug, upload key and, with Play App Signing, the Play signing key). Your RP ID must also be enabled for your organization.
  • Email / SMS OTP, OAuth and passkey sign-up go through the Auth Proxy: create an Auth Proxy configuration in the Dashboard and pass its ID as authProxyConfigId.

Configure

apiBaseUrl and authProxyBaseUrl default to the 0xkey production hosts.

Sign in

OTP login fallback. The SDK first tries an attested login. Only if the server reports that attested login is unavailable, and authProxyConfigId is set, it falls back to the Auth Proxy otp_login_v2 route. It never falls back on HTTP 403 or an ATTESTED_LOGIN_* error (either can mean MFA is required); the original error is thrown. Scoped logins never fall back.

Wallets and signing

Prefer signTransaction over signRawPayload for transactions: transaction-field policies (eth.tx.*, solana.tx.*) apply to transaction-signing activities. See Policy language. To require a passkey for each signature, create a client with a passkey stamper:

Policies

ZeroXKeyClient exposes the policy endpoints, including deletion:
A missing policy ID returns HTTP 404. See Policy overview.

Errors

An activity that is not COMPLETED is always thrown, never returned as success. Branch on code / httpStatus, not on message text; see Errors.

More