The Android SDK is a Kotlin library distributed through JitPack. Add the JitPack repo, pull the dependency, then initialise the singleton from yourDocumentation Index
Fetch the complete documentation index at: https://docs.spotzee.com/llms.txt
Use this file to discover all available pages before exploring further.
Application subclass.
Requirements
- Android SDK 23+ (Android 6.0 Marshmallow and later)
- Java 17 toolchain
- Kotlin (Java consumers work, but the API uses Kotlin’s
suspendand default arguments)
Install
In your project’ssettings.gradle, add the JitPack repo to dependencyResolutionManagement:
build.gradle, add the dependency:
Initialise
SubclassApplication and call Spotzee.initialize from onCreate. Use a publishable key (pk_…); read Manage API keys for how to mint one.
AndroidManifest.xml:
initialize returns the Spotzee instance. Stash it as a companion object (or inject through your DI framework) so other layers can call analytics.track(…), analytics.identify(…), and so on.
To wire in-app notifications and deeplinks, also pass an InAppDelegate:
What every request carries
The SDK adds these headers to every API call. You don’t set them yourself.| Header | Value | Why |
|---|---|---|
Authorization | Bearer <your apiKey> | Authenticates the request |
Spotzee-Version | 2026-04-28 | Pins the API version this SDK release targets |
x-spotzee-client-type | sdk-android | Identifies traffic from this SDK. Read Identify your API client type |
Content-Type | application/json | Set on POST and PUT requests |
Identity(externalId = …) lands as external_id on the wire.
Identity persistence
The SDK persists three values inSharedPreferences:
anonymousId: minted on first call, kept across app launches.externalId: cached on the singleton afteridentifysucceeds.deviceId: a per-install UUID, used when registering for push.
analytics.reset() on sign-out to clear externalId and the persisted anonymous ID.
Errors
Failed requests returnResult.failure(IOException(...)) with a one-line summary that includes the HTTP status, the API error code (when present), the message, and the request_id. The legacy { error: string } shape and the new RFC 7807 envelope are both parsed; quote request_id to support.
track and register are fire-and-forget and don’t return failures to your code; check Logcat under the Spotzee tag for transient issues. identify, alias, getNotifications, and consume are suspend and surface results explicitly.
Debugging
PassisDebug = true (or isDebug = BuildConfig.DEBUG) to Spotzee.initialize to flip the SDK’s HTTP logging to body level. Every request and response prints to Logcat under tag OkHttp so you can inspect payloads. Leave isDebug = false (the default) for production builds.
Next steps
Identify users
Link anonymous activity to a known user.
Track events
Send custom events with properties.
Push notifications
Register for FCM and route incoming pushes through the SDK.
In-app notifications and deeplinks
Render in-app dialogs and unwrap App Links.