Quick Start
This guide walks you through creating an app, installing the SDK, and getting your first attributed install.
Prerequisites
Section titled “Prerequisites”- An Android or iOS app project (or a Kotlin Multiplatform project targeting both)
-
Install the CLI, log in, and create your app
Terminal window # macOSbrew install bmcreations/tap/trace# log in with your account (opens browser)trace login# create your apptrace initThis gives you an API key (e.g.
tr_live_xxxx) and a hash salt (64-character hex string). The app is linked to your account automatically.See CLI Installation for other platforms or
trace login --api-key=xxxfor CI/CD. -
Add the SDK
Add the Trace SDK to your module-level
build.gradle.kts:dependencies {implementation("io.traceclick:trace-sdk:<version>")}Add the Trace SDK via Swift Package Manager:
https://github.com/bmcreations/trace-sdk-iosOr add to your
Package.swift:.package(url: "https://github.com/bmcreations/trace-sdk-ios", from: "<version>")Add the Trace SDK to your shared module’s
build.gradle.kts:kotlin {sourceSets {commonMain.dependencies {implementation("io.traceclick:trace-sdk:<version>")// Optional: Navigation3 integration for Compose Multiplatformimplementation("io.traceclick:trace-sdk-nav3-kmp:<version>")}}}All Compose components (
TraceProvider,rememberDeepLinkMapper,rememberTraceEntryDecorator) work incommonMain— the same code runs on both Android and iOS via Compose Multiplatform. Seekmp/for a complete working example. -
Initialize on app launch
class MyApp : Application() {override fun onCreate() {super.onCreate()Trace.initialize(context = this,config = TraceConfig(apiKey = "tr_live_xxxxxxxxxxxx",hashSalt = "your_64_char_hex_salt",region = Region.US))}}@mainstruct MyApp: App {init() {TraceClient.shared.initialize(config: TraceConfig(apiKey: "tr_live_xxxxxxxxxxxx",hashSalt: "your_64_char_hex_salt"))}}The SDK is KMP — Android and KMP projects use the same API. On iOS, the Swift package wraps the KMP framework.
That’s it. The SDK automatically reports the install to Trace and performs attribution on first launch.
-
Create a short link
Terminal window trace links create --deep-link-path /welcome \--campaign-id launch_campaign \--fallback-url https://yourapp.comOutput:
✓ Link createdShort Code abc123Short URL https://yourapp.traceclick.io/l/abc123QR Code URL https://yourapp.traceclick.io/l/abc123.pngTerminal window curl -X POST https://api.traceclick.io/v1/links \-H "X-Api-Key: tr_live_xxxxxxxxxxxx" \-H "Content-Type: application/json" \-d '{"deepLinkPath": "/welcome","campaignId": "launch_campaign","fallbackUrl": "https://yourapp.com"}'Response:
{"shortCode": "abc123","shortUrl": "https://yourapp.traceclick.io/l/abc123"} -
Handle the deep link
Trace.setDeepLinkListener { deepLink ->// deepLink.path = "/welcome"// deepLink.isDeferred = true (arrived via install attribution)navigateTo(deepLink.path)}TraceClient.shared.setDeepLinkListener { deepLink in// deepLink.path = "/welcome"// deepLink.isDeferred = truenavigateTo(deepLink.path)}
What just happened?
Section titled “What just happened?”- You created a short link with a deep link path of
/welcome - When a user clicks that link, Trace records the click and redirects to the app store
- After the user installs and opens the app, the SDK calls Trace
- Trace matches the install to the click and returns the attribution result
- The deferred deep link (
/welcome) is delivered to your listener
Next steps
Section titled “Next steps”- CLI commands — manage apps, links, metrics, and privacy from the terminal
- Android setup — full integration guide including deep link routing and Navigation3
- iOS setup — Universal Links, SwiftUI
.onDeepLink()integration - Configuration — regions, debug mode, test mode, privacy opt-out
- Deep links — type-safe routing, auth gates, deferred link handling
- Links API — create and manage short links programmatically
- Webhooks — get real-time notifications for installs, opens, and events via Slack, Discord, Teams, or custom HTTP endpoints