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

# Remote Evaluation

{% hint style="warning" %}
Server SDKs do not support Remote Evaluation.
{% endhint %}

Remote Evaluation is a mode in which the Hackle server evaluates the user in advance and the SDK looks up the result.

Because evaluation is based on user information stored on the Hackle server, use this mode when distribution must be based on the latest user information stored on the server.

### Feature Support

Remote Evaluation evaluates based on user information stored on the Hackle server. Because evaluation runs on the server, the SDK communicates with the server to re-evaluate when user information changes.

{% hint style="info" %}
When you use Remote Evaluation, user information is not stored on the device or in the browser.

Any user information already stored from previous use of Local Evaluation is deleted.
{% endhint %}

<table><thead><tr><th width="470.140625">Feature</th><th align="center">Local Evaluation</th><th align="center">Remote Evaluation</th></tr></thead><tbody><tr><td>A/B Test distribution</td><td align="center">✅</td><td align="center">✅</td></tr><tr><td>Feature Flag decision</td><td align="center">✅</td><td align="center">✅</td></tr><tr><td>Remote Config lookup</td><td align="center">✅</td><td align="center">✅</td></tr><tr><td>Evaluation based on user information stored on the device</td><td align="center">✅</td><td align="center">❌</td></tr><tr><td>Evaluation based on user information stored on the server</td><td align="center">❌</td><td align="center">✅</td></tr><tr><td>Re-evaluation without server communication when user information changes</td><td align="center">✅</td><td align="center">❌</td></tr></tbody></table>

### How It Works

The Hackle server evaluates A/B Tests, Feature Flags, and more for the user in advance, and the SDK fetches only the evaluation results and stores them internally.\
When distribution is needed, it looks up the stored evaluation results.

```mermaid
sequenceDiagram
    participant App as Client
    participant SDK as SDK
    participant Hackle as Hackle server

    App->>SDK: Initialize SDK
    SDK->>Hackle: Send user information
    activate Hackle
    Note over Hackle: Evaluate A/B Tests, Feature Flags,<br/>and more for the user
    Hackle-->>SDK: Evaluation result
    deactivate Hackle
    Note over SDK: Store the evaluation result internally

    App->>SDK: Distribution/decision call
    SDK->>SDK: Look up the stored evaluation result<br/>(no network call)

    opt User information changes (setUser, property update, etc.)
        App->>SDK: Change user information
        SDK->>Hackle: Send the updated user information
        activate Hackle
        Note over Hackle: Re-evaluate
        Hackle-->>SDK: Latest evaluation result
        deactivate Hackle
        Note over SDK: Update the stored evaluation result
    end
```

1. On SDK initialization, the SDK sends user information to the Hackle server.
2. The Hackle server evaluates A/B Tests, Feature Flags, and more for the user, and the SDK fetches the evaluation results and stores them internally.
3. On a distribution/decision call, the SDK looks up the stored evaluation results. No network call occurs in this process.

{% hint style="success" %}
If user information has not changed, the SDK looks up the stored evaluation results, so distribution is handled without network delay.
{% endhint %}

### When User Information Changes

When the User Identifier changes (`setUser`, `setUserId`, `setDeviceId`, `resetUser`) or User Properties are updated,\
the SDK sends the updated user information to the Hackle server and fetches the latest evaluation results to refresh what it has stored.

{% hint style="warning" %}
Remote Evaluation communicates with the server to run evaluation again whenever user information changes.

Because it goes through the update user information → server evaluation → apply result flow, there is latency before the latest result is applied.
{% endhint %}

### Reflecting Dashboard Changes

With Remote Evaluation, the SDK stores and looks up evaluation results that the Hackle server performed in advance.\
Therefore, it returns results based on **when the evaluation was performed**, not on the Dashboard settings at the moment the distribution/decision was called.

Evaluation is performed at the following points, and the evaluation results stored in the SDK are refreshed at that time.

* On SDK initialization
* When user information is updated (`setUser`, `setUserId`, `setDeviceId`, `resetUser`, User Property update)

{% hint style="warning" %}
Although Remote Evaluation runs evaluation on the Hackle server, it does not communicate with the server to re-evaluate with the latest configuration on every distribution call.

Even if you adjust an A/B Test's traffic allocation or turn a Feature Flag on or off in the Dashboard, the SDK looks up the existing evaluation results until it fetches the evaluation results again.
{% 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/en/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.
