> 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/development-guide/sdk/evaluation-mode/remote-evaluation.md).

# 원격 평가

{% hint style="warning" %}
서버 SDK는 원격 평가를 지원하지 않습니다.
{% endhint %}

원격 평가는 핵클 서버가 사용자에 대한 평가를 미리 수행하고, SDK는 그 결과를 조회하는 방식입니다.

핵클 서버에 저장된 사용자 정보를 기반으로 평가하므로, 서버에 저장된 최신 사용자 정보를 기준으로 분배해야 하는 경우 사용합니다.

### 기능 지원

원격 평가는 핵클 서버에 저장된 사용자 정보를 기반으로 평가합니다. 평가가 서버에서 수행되므로, 사용자 정보가 변경되면 서버와 통신해 다시 평가합니다.

{% hint style="info" %}
원격 평가를 사용하면 기기 또는 브라우저에 사용자 정보를 저장하지 않습니다.

기존에 로컬 평가를 사용하며 저장된 사용자 정보가 있는 경우 삭제 처리합니다.
{% endhint %}

<table><thead><tr><th width="470.140625">기능</th><th align="center">로컬 평가</th><th align="center">원격 평가</th></tr></thead><tbody><tr><td>A/B 테스트 분배</td><td align="center">✅</td><td align="center">✅</td></tr><tr><td>기능 플래그 결정</td><td align="center">✅</td><td align="center">✅</td></tr><tr><td>원격 구성 확인</td><td align="center">✅</td><td align="center">✅</td></tr><tr><td>디바이스에 저장된 사용자 정보 기반 평가</td><td align="center">✅</td><td align="center">❌</td></tr><tr><td>서버에 저장된 사용자 정보 기반 평가</td><td align="center">❌</td><td align="center">✅</td></tr><tr><td>사용자 정보 변경 시 서버 통신 없이 재평가</td><td align="center">✅</td><td align="center">❌</td></tr></tbody></table>

### 동작 방식

핵클 서버가 사용자에 대한 A/B 테스트, 기능 플래그 등의 평가를 미리 수행하고, SDK는 그 평가 결과만 받아와 내부에 저장합니다.\
이후 분배가 필요한 시점에는 저장된 평가 결과를 조회합니다.

```mermaid
sequenceDiagram
    participant App as 클라이언트
    participant SDK as SDK
    participant Hackle as 핵클 서버

    App->>SDK: SDK 초기화
    SDK->>Hackle: 사용자 정보 전달
    activate Hackle
    Note over Hackle: 사용자에 대한<br/>A/B 테스트, 기능 플래그 등을 평가
    Hackle-->>SDK: 평가 결과
    deactivate Hackle
    Note over SDK: 평가 결과를 내부에 저장

    App->>SDK: 분배/결정 호출
    SDK->>SDK: 저장된 평가 결과 조회<br/>(네트워크 호출 없음)

    opt 사용자 정보 변경 (setUser, 속성 업데이트 등)
        App->>SDK: 사용자 정보 변경
        SDK->>Hackle: 변경된 사용자 정보 전달
        activate Hackle
        Note over Hackle: 다시 평가
        Hackle-->>SDK: 최신 평가 결과
        deactivate Hackle
        Note over SDK: 저장된 평가 결과 갱신
    end
```

1. SDK 초기화 시 사용자 정보를 핵클 서버로 전달합니다.
2. 핵클 서버가 사용자에 대한 A/B 테스트, 기능 플래그 등을 평가하고, SDK는 평가 결과를 받아와 내부에 저장합니다.
3. 분배/결정 호출 시 저장된 평가 결과를 조회합니다. 이 과정에서 네트워크 호출이 발생하지 않습니다.

{% hint style="success" %}
사용자 정보가 바뀌지 않았다면 저장된 평가 결과를 조회하므로 네트워크 지연 없이 분배를 처리할 수 있습니다.
{% endhint %}

### 사용자 정보가 변경되는 경우

사용자 식별자가 변경되거나(`setUser`, `setUserId`, `setDeviceId`, `resetUser`) 사용자 속성이 업데이트되면, \
SDK가 변경된 사용자 정보를 핵클 서버로 전달하고 최신 평가 결과를 받아와 갱신합니다.

{% hint style="warning" %}
원격 평가는 사용자 정보가 바뀔 때마다 서버와 통신해 평가를 다시 수행합니다.

사용자 정보 수정 → 서버 평가 → 결과 반영 과정을 거치므로, 최신 결과가 반영되기까지 레이턴시가 존재합니다.
{% endhint %}

### 대시보드 변경사항 반영

원격 평가는 핵클 서버가 미리 수행한 평가 결과를 SDK가 저장해두고 조회합니다.\
따라서 분배/결정을 호출한 시점의 대시보드 설정이 아니라, **평가가 수행된 시점**을 기반으로 한 결과를 반환합니다.

평가는 다음 시점에 수행되며, 이때 SDK에 저장된 평가 결과가 갱신됩니다.

* SDK 초기화 시
* 사용자 정보가 업데이트될 시 (`setUser`, `setUserId`, `setDeviceId`, `resetUser`, 사용자 속성 업데이트)

{% hint style="warning" %}
원격 평가는 평가를 핵클 서버에서 수행하지만, 분배 호출할 때마다 서버와 통신해 최신 설정으로 다시 평가하지는 않습니다.

대시보드에서 A/B 테스트의 트래픽 분배율을 조정하거나 기능 플래그를 켜고 끄더라도, SDK가 평가 결과를 다시 받아오기 전까지는 기존 평가 결과를 조회합니다.
{% endhint %}


---

# 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 dynamically by asking a question.

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

```
GET https://docs.hackle.io/development-guide/sdk/evaluation-mode/remote-evaluation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
