# Quick Start

This guide shows you how to integrate the Hackle SDK to run A/B Tests and collect events.

{% hint style="info" %}
You can find your SDK Key in the Hackle Dashboard under **Settings > SDK Integration Info**.
{% endhint %}

{% tabs %}
{% tab title="Android" %}
{% stepper %}
{% step %}
**Install SDK**

Add the dependency to `build.gradle`.

```gradle
repositories {
    mavenCentral()
}

dependencies {
    implementation 'io.hackle:hackle-android-sdk:2+'
}
```

{% endstep %}

{% step %}
**Initialize SDK**

```kotlin
import io.hackle.android.Hackle
import io.hackle.android.initialize

Hackle.initialize(applicationContext, "YOUR_APP_SDK_KEY") {
    // SDK initialization complete
}
```

{% endstep %}

{% step %}
**Variation Distribution**

Pass the Experiment Key to determine the user's variation.

```kotlin
val hackleApp = Hackle.app()
val variation = hackleApp.variation(EXPERIMENT_KEY)

if (variation == Variation.A) {
    // Group A
} else if (variation == Variation.B) {
    // Group B
}
```

{% endstep %}

{% step %}
**Event Tracking**

Track user behavior events.

```kotlin
hackleApp.track("EVENT_KEY")
```

{% endstep %}
{% endstepper %}

For detailed options at each step, refer to the [Android SDK documentation](/en/development-guide/android.md).
{% endtab %}

{% tab title="iOS" %}
{% stepper %}
{% step %}
**Install SDK**

Install via Swift Package Manager or CocoaPods.

**Swift Package Manager**

```
https://github.com/hackle-io/hackle-ios-sdk.git
```

**CocoaPods**

```ruby
pod 'Hackle'
```

{% endstep %}

{% step %}
**Initialize SDK**

```swift
import Hackle

Hackle.initialize(sdkKey: "YOUR_APP_SDK_KEY") {
    // SDK initialization complete
}
```

{% endstep %}

{% step %}
**Variation Distribution**

Pass the Experiment Key to determine the user's variation.

```swift
let hackleApp = Hackle.app()
let variation = hackleApp.variation(experimentKey: EXPERIMENT_KEY)

if variation == "A" {
    // Group A
} else if variation == "B" {
    // Group B
}
```

{% endstep %}

{% step %}
**Event Tracking**

Track user behavior events.

```swift
hackleApp.track(eventKey: "EVENT_KEY")
```

{% endstep %}
{% endstepper %}

For detailed options at each step, refer to the [iOS SDK documentation](/en/development-guide/ios.md).
{% endtab %}

{% tab title="JavaScript" %}
{% stepper %}
{% step %}
**Install SDK**

Install via npm.

```bash
npm install @hackler/javascript-sdk
```

{% endstep %}

{% step %}
**Initialize SDK**

```javascript
import * as Hackle from "@hackler/javascript-sdk";

const hackleClient = Hackle.createInstance("YOUR_BROWSER_SDK_KEY");
```

{% endstep %}

{% step %}
**Variation Distribution**

Pass the Experiment Key to determine the user's variation.

```javascript
hackleClient.onReady(function () {
    const variation = hackleClient.variation(EXPERIMENT_KEY);

    if (variation === "A") {
        // Group A
    } else if (variation === "B") {
        // Group B
    }
});
```

{% endstep %}

{% step %}
**Event Tracking**

Track user behavior events.

```javascript
hackleClient.track({ key: "EVENT_KEY" });
```

{% endstep %}
{% endstepper %}

For detailed options at each step, refer to the [JavaScript SDK documentation](/en/development-guide/javascript.md).
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/development-guide/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
