> 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/flutter/flutter-remote-config.md).

# 원격 구성 적용

원격 구성은 애플리케이션에서 관리되고 있는 값, 또는 속성들을 핵클 대시보드에서 정의한 파라미터 값들로 대체하여 실시간으로 애플리케이션의 동작 및 설정 값들을 제어할 수 있는 기능입니다.

핵클의 대시보드의 원격 구성 화면으로 이동하여 파라미터 정보들을 설정하고, 사용자 식별 규칙에 따른 값들을 설정할 수 있습니다.

## getRemoteConfig

`getRemoteConfig()` 메소드를 호출하면 사용자에 대한 원격 구성 정보(설정한 파라미터 및 규칙 정보)를 담고 있는 `RemoteConfig` 인스턴스를 얻을 수 있습니다.

```dart
import "package:hackle/hackle.dart";

// 원격 구성 정보를 담은 인스턴스를 반환합니다.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();
```

## 원격 구성 파라미터 조회 <a href="#get-remote-config-parameter" id="get-remote-config-parameter"></a>

* `getRemoteConfig()` 메소드를 통해 전달받은 `RemoteConfig` 인스턴스에는 원격 구성에서 설정한 전체 파라미터 설정 정보가 존재합니다.
* 핵클의 원격 구성 화면에서 설정한 파라미터 값이 key, value 형태로 존재하기 때문에, 설정한 파라미터 유형에 따라 아래 메소드를 사용하여 설정한 파라미터 값을 받아 활용할 수 있습니다.
* 원격 구성 파라미터 설정화면에서 규칙 및 값을 유동적으로 변경할 수 있습니다.

{% hint style="warning" %}
보관 후 원격 구성과 관련된 코드를 제거하세요.

원격 구성 파라미터를 보관한 경우 더이상 파라미터 정보에 접근 할 수 없습니다.\
원격 구성 파라미터 보관 후에는 반드시 관련된 코드를 정리해주시기 바랍니다.
{% endhint %}

* defaultValue는 원격 구성 값을 결정할 수 없을 때 반환되는 값입니다. 입력한 defaultValue는 다음과 같은 상황에서 반환될 수 있습니다.
  * 원격 구성화면에서 설정한 타입 유형과 다른 유형의 값을 입력
  * 설정되지 않은 parameter key 호출
  * Hackle SDK 초기화 실패
  * 잘못된 식별자 정보가 입력되거나 존재하지 않을 때
* 설정한 정보를 올바르게 받기 위해서는 입력하신 defaultValue와 핵클 원격 구성 파라미터 화면에서 설정한 유형(type)이 동일해야 합니다.
* 원격 구성 파라미터 화면에서 설정한 JSON 타입은 문자열(String)형태로 받을 수 있습니다. JSON 타입의 default 값은 문자열 타입으로 입력해야 합니다.

### getString

* STRING, JSON 유형으로 설정된 파라미터 값을 반환합니다.
* 상태 결정에 따라 기본 값 혹은 규칙에 설정된 값을 반환합니다.

```dart
import "package:hackle/hackle.dart";

// 원격 구성 정보를 담은 인스턴스를 반환합니다.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

String strValue = await remoteConfig.getString("parameter_key_string_type", "defaultValue");

String jsonValue = await remoteConfig.getString("parameter_key_json_type", "defaultValue");
```

### getInt

* Number 유형으로 설정된 parameter 값을 int 타입으로 반환합니다.
* 상태 결정에 따라 기본 값 혹은 규칙에 설정된 값을 반환합니다.

```dart
import "package:hackle/hackle.dart";

// 원격 구성 정보를 담은 인스턴스를 반환합니다.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

int intValue = await remoteConfig.getInt("parameter_key_number_type", 0);
```

### getDouble

* Number 유형으로 설정된 parameter 값을 double 타입으로 반환합니다.
* 상태 결정에 따라 기본 값 혹은 규칙에 설정된 값을 반환합니다.

```dart
import "package:hackle/hackle.dart";

// 원격 구성 정보를 담은 인스턴스를 반환합니다.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

double doubleValue = await remoteConfig.getDouble("parameter_key_number_type", 0.0);
```

### getBool

* Boolean 유형으로 설정된 parameter값을 반환합니다.
* 상태 결정에 따라 기본 값 혹은 규칙에 설정된 값을 반환합니다.

```dart
import "package:hackle/hackle.dart";

// 원격 구성 정보를 담은 인스턴스를 반환합니다.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

bool boolValue = await remoteConfig.getBool("parameter_key_boolean_type", false);
```


---

# 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/development-guide/flutter/flutter-remote-config.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.
