> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appdna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install, configure, and verify the SDK in 5 minutes

# 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.

<Info>
  API keys are found in **Console → Settings → SDK → API Keys**. Production keys start with `adn_live_`, sandbox keys with `adn_test_`.
</Info>

***

## Step 1: Install the SDK

<Tabs>
  <Tab title="iOS">
    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-inc/appdna-sdk-ios.git
    ```

    3. Select the package **AppDNASDK** and add it to your target.

    **Requirements:** iOS 16+, Swift 5.9+
  </Tab>

  <Tab title="Android">
    Add the dependency to your module-level `build.gradle`:

    ```kotlin theme={null}
    dependencies {
        implementation("ai.appdna:sdk-android:1.0.43")
    }
    ```

    Make sure `mavenCentral()` is in your project-level repositories.

    **Requirements:** Android SDK 24+ (Android 7.0), Kotlin 1.9+
  </Tab>

  <Tab title="Flutter">
    Add the package to your `pubspec.yaml`:

    ```yaml theme={null}
    dependencies:
      appdna_sdk: ^1.0.9
    ```

    Then run:

    ```bash theme={null}
    flutter pub get
    ```

    **Requirements:** Dart 3.0+, Flutter 3.10+
  </Tab>

  <Tab title="React Native">
    Install via npm or yarn:

    ```bash theme={null}
    npm install @appdna-ai/react-native-sdk
    ```

    For iOS, install the native pods:

    ```bash theme={null}
    cd ios && pod install
    ```

    **Requirements:** React Native >=0.76.9 (New Architecture required), iOS 16+, Android SDK 24+
  </Tab>
</Tabs>

***

## 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.

<Tabs>
  <Tab title="iOS">
    ```swift theme={null}
    import AppDNASDK

    // In your AppDelegate or App init
    AppDNA.configure(
        apiKey: "adn_live_xxx",
        environment: .production,
        options: AppDNAOptions(logLevel: .debug)
    )
    ```
  </Tab>

  <Tab title="Android">
    ```kotlin theme={null}
    import ai.appdna.sdk.AppDNA
    import ai.appdna.sdk.Environment
    import ai.appdna.sdk.AppDNAOptions
    import ai.appdna.sdk.LogLevel

    // In your Application.onCreate()
    AppDNA.configure(
        context = this,
        apiKey = "adn_live_xxx",
        environment = Environment.PRODUCTION,
        options = AppDNAOptions(logLevel = LogLevel.DEBUG)
    )
    ```
  </Tab>

  <Tab title="Flutter">
    ```dart theme={null}
    import 'package:appdna_sdk/appdna_sdk.dart';

    // In your main() or initState
    await AppDNA.configure(
      apiKey: "adn_live_xxx",
      env: AppDNAEnvironment.production,
      options: AppDNAOptions(logLevel: AppDNALogLevel.debug),
    );
    ```
  </Tab>

  <Tab title="React Native">
    ```javascript theme={null}
    import { AppDNA } from '@appdna-ai/react-native-sdk';

    // In your App component or index.js
    await AppDNA.configure("adn_live_xxx", "production", {
      logLevel: "debug",
    });
    ```
  </Tab>
</Tabs>

<Warning>
  Replace `adn_live_xxx` with your actual API key. Use `adn_test_` keys during development to send events to the sandbox environment — the host is the same `api.appdna.ai`; the key prefix selects sandbox vs production.
</Warning>

***

## 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.

<Tabs>
  <Tab title="iOS">
    ```swift theme={null}
    AppDNA.identify(
        userId: "user-123",
        traits: ["plan": "premium"]
    )
    ```
  </Tab>

  <Tab title="Android">
    ```kotlin theme={null}
    AppDNA.identify(
        userId = "user-123",
        traits = mapOf("plan" to "premium")
    )
    ```
  </Tab>

  <Tab title="Flutter">
    ```dart theme={null}
    await AppDNA.identify(
      "user-123",
      traits: {"plan": "premium"},
    );
    ```
  </Tab>

  <Tab title="React Native">
    ```javascript theme={null}
    await AppDNA.identify("user-123", {
      plan: "premium",
    });
    ```
  </Tab>
</Tabs>

<Note>
  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`.
</Note>

***

## 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.

<Tabs>
  <Tab title="iOS">
    ```swift theme={null}
    AppDNA.track(
        event: "workout_completed",
        properties: ["duration": 45]
    )
    ```
  </Tab>

  <Tab title="Android">
    ```kotlin theme={null}
    AppDNA.track(
        event = "workout_completed",
        properties = mapOf("duration" to 45)
    )
    ```
  </Tab>

  <Tab title="Flutter">
    ```dart theme={null}
    await AppDNA.track(
      "workout_completed",
      properties: {"duration": 45},
    );
    ```
  </Tab>

  <Tab title="React Native">
    ```javascript theme={null}
    AppDNA.track("workout_completed", {
      duration: 45,
    });
    ```
  </Tab>
</Tabs>

***

## Step 5: Verify in the Dashboard

Open the **Event Debugger** in [console.appdna.ai](https://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.

<Check>
  If you see your event in the debugger, you are all set. The SDK is installed, configured, and sending data to AppDNA.
</Check>

***

## What's Next?

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="book" href="/concepts">
    Learn about offline-first design, config bundles, experiment bucketing, and more.
  </Card>

  <Card title="Paywalls" icon="credit-card" href="/sdks/ios/paywall">
    Design and deploy server-driven paywalls without app updates.
  </Card>

  <Card title="Experiments" icon="flask" href="/guides/experiments">
    Run A/B tests with deterministic, cross-platform bucketing.
  </Card>

  <Card title="Push Notifications" icon="bell" href="/sdks/ios/push">
    Send targeted push campaigns and automated retention journeys.
  </Card>
</CardGroup>
