Skip to main content

Quickstart

Get AppDNA running in your app in five steps. By the end, you will have the SDK installed, configured with your API key, a user identified, and your first event flowing into the dashboard.
API keys are found in Console → Settings → SDK → API Keys. Production keys start with adn_live_, sandbox keys with adn_test_.

Step 1: Install the SDK

Add the AppDNA SDK via Swift Package Manager:
  1. In Xcode, go to File → Add Package Dependencies…
  2. Enter the repository URL:
https://github.com/appdna-ai/appdna-sdk-ios.git
  1. Select the package AppDNASDK and add it to your target.
Requirements: iOS 15+, Swift 5.9+

Step 2: Configure the SDK

Initialize AppDNA as early as possible in your app’s lifecycle — ideally in your app delegate, application class, or root component.
import AppDNASDK

// In your AppDelegate or App init
AppDNA.configure(
    apiKey: "adn_live_xxx",
    environment: .production,
    options: AppDNAOptions(logLevel: .debug)
)
Replace adn_live_xxx with your actual API key. Use adn_test_ keys during development to send events to the sandbox environment at sandbox-api.appdna.ai.

Step 3: Identify the User

Once your user signs in (or you have a stable user identifier), call identify to link events to that user. You can also pass traits that AppDNA uses for segmentation and experiment targeting.
AppDNA.identify(
    userId: "user-123",
    traits: ["plan": "premium"]
)
Before identify is called, the SDK generates an anonymous ID on first launch. Events are tracked against this anonymous ID and automatically linked when you call identify.

Step 4: Track Your First Event

Send a custom event with properties. These events flow into AppDNA analytics and can be used as experiment goals, retention triggers, and webhook payloads.
AppDNA.track(
    event: "workout_completed",
    properties: ["duration": 45]
)

Step 5: Verify in the Dashboard

Open the Event Debugger in console.appdna.ai to confirm your events are arriving:
  1. Navigate to Console → Events → Debugger.
  2. Select your app and environment.
  3. You should see workout_completed appear within a few seconds.
If you see your event in the debugger, you are all set. The SDK is installed, configured, and sending data to AppDNA.

What’s Next?