# 빠른 시작

핵클 SDK를 연동하여 A/B 테스트를 실행하고 이벤트를 수집하는 방법을 안내합니다.

{% hint style="info" %}
SDK 키는 핵클 대시보드 > **설정 > SDK 연동 정보**에서 확인할 수 있습니다.
{% endhint %}

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

`build.gradle`에 의존성을 추가합니다.

```gradle
repositories {
    mavenCentral()
}

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

{% endstep %}

{% step %}
**SDK 초기화**

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

Hackle.initialize(applicationContext, "YOUR_APP_SDK_KEY") {
    // SDK 초기화 완료
}
```

{% endstep %}

{% step %}
**A/B 테스트 분배**

실험 키를 전달하여 사용자의 테스트 그룹을 확인합니다.

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

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

{% endstep %}

{% step %}
**이벤트 전송**

사용자 행동 이벤트를 전송합니다.

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

{% endstep %}
{% endstepper %}

각 단계의 상세 옵션은 [Android SDK 문서](/development-guide/android.md)를 참고하세요.
{% endtab %}

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

Swift Package Manager 또는 CocoaPods로 설치합니다.

**Swift Package Manager**

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

**CocoaPods**

```ruby
pod 'Hackle'
```

{% endstep %}

{% step %}
**SDK 초기화**

```swift
import Hackle

Hackle.initialize(sdkKey: "YOUR_APP_SDK_KEY") {
    // SDK 초기화 완료
}
```

{% endstep %}

{% step %}
**A/B 테스트 분배**

실험 키를 전달하여 사용자의 테스트 그룹을 확인합니다.

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

if variation == "A" {
    // 그룹 A
} else if variation == "B" {
    // 그룹 B
}
```

{% endstep %}

{% step %}
**이벤트 전송**

사용자 행동 이벤트를 전송합니다.

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

{% endstep %}
{% endstepper %}

각 단계의 상세 옵션은 [iOS SDK 문서](/development-guide/ios.md)를 참고하세요.
{% endtab %}

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

npm으로 설치합니다.

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

{% endstep %}

{% step %}
**SDK 초기화**

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

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

{% endstep %}

{% step %}
**A/B 테스트 분배**

실험 키를 전달하여 사용자의 테스트 그룹을 확인합니다.

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

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

{% endstep %}

{% step %}
**이벤트 전송**

사용자 행동 이벤트를 전송합니다.

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

{% endstep %}
{% endstepper %}

각 단계의 상세 옵션은 [JavaScript SDK 문서](/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/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.
