> For the complete documentation index, see [llms.txt](https://docs.hackle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hackle.io/en/development-guide/quick-start.md).

# 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](https://docs.hackle.io/en/development-guide/android.md).
{% endtab %}

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

Install via Swift Package Manager.

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

{% 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](https://docs.hackle.io/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](https://docs.hackle.io/en/development-guide/javascript.md).
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
