Quickstart
You need an app_id (public, goes into your APK) and, to read data, a platform key (dak_…, secret, never put it in an app). Both come with your early-access account. You can also create more apps with the REST API.
1. Add the repository and dependency
Section titled “1. Add the repository and dependency”dependencyResolutionManagement { repositories { google() mavenCentral() maven("https://pulsark.org/maven/") }}dependencies { implementation("org.pulsark:analytics:0.1.0")}Requirements: minSdk 21+. The SDK adds the INTERNET and ACCESS_NETWORK_STATE permissions. Dependencies: OkHttp, AndroidX WorkManager and Lifecycle.
2. Initialize in Application.onCreate
Section titled “2. Initialize in Application.onCreate”import org.pulsark.analytics.Profileimport org.pulsark.analytics.Pulsarkimport org.pulsark.analytics.PulsarkConfig
class MyApp : Application() { override fun onCreate() { super.onCreate() Pulsark.init(this, appId = "app_xxxxxxxxxxxx", config = PulsarkConfig(profile = Profile.GAME)) }}Pulsark.init(this, "app_xxxxxxxxxxxx", new PulsarkConfig());init takes < 5 ms and does all I/O on a background thread. Calls from secondary processes (for example an ad SDK’s process) are ignored automatically.
3. Record consent
Section titled “3. Record consent”Until you call setConsent, only essential events are collected (first_open, session_start, app_foreground/app_background, ad_impression). After the user agrees:
Pulsark.setConsent(ConsentState.GRANTED)See Privacy & data for what each state means.
4. Track something
Section titled “4. Track something”Pulsark.track("level_end", mapOf("level_id" to "3", "result" to "win", "duration_ms" to 41250))Sessions, foreground time and screens (page_view) are tracked for you. For ad revenue, see Ad revenue.
5. Check it works
Section titled “5. Check it works”- Set
PulsarkConfig(debug = true)and watch Logcat with the tagPulsark. - Call
Pulsark.flush()to upload immediately instead of waiting for the next batch. - Metrics are aggregated hourly. Query today’s DAU:
curl -H "Authorization: Bearer $PULSARK_KEY" \ "https://api.pulsark.org/api/v1/metrics/dau?app_id=app_xxxxxxxxxxxx"Or just ask your AI assistant after connecting MCP.
- SDK reference — every method and option.
- Events — naming rules and limits.
- Integrate with AI — a ready-made prompt that does steps 1–4 for you.