# Remote Config

{% hint style="info" %}
This feature is supported in React SDK version 11.7.3 and above.
{% endhint %}

Remote Config is a feature that allows you to replace values or properties managed in your application with parameter values defined in the Hackle Dashboard, enabling real-time control of your application's behavior and configuration.

Navigate to the Remote Config screen on the Hackle Dashboard to configure parameter information and set values based on user identification rules.

## useRemoteConfig() or useLoadableRemoteConfig()

Using the `useRemoteConfig()` or `useLoadableRemoteConfig()` Hooks API returns a `HackleRemoteConfig` instance containing the Remote Config information (configured parameters and rule information) for the user. You can access the desired parameter and retrieve its value through the methods provided by `HackleRemoteConfig`.

```javascript
// 원격 구성 정보를 담은 인스턴스를 반환합니다.
const remoteConfig = useRemoteConfig()

// SSR 사용 시
// 원격 구성 정보를 담은 인스턴스를 반환합니다. - Loadable 사용 시
const { isLoading, remoteConfig } = useLoadableRemoteConfig()
```

## Querying Remote Config Parameters

* The `HackleRemoteConfig` returned by the `useRemoteConfig()` or `useLoadableRemoteConfig()` Hooks API provides a `get()` method for querying parameter values.
* Since parameter values configured in Hackle's Remote Config screen exist in key-value format, you can use the following method based on the configured parameter type to retrieve the configured parameter value.

{% hint style="warning" %}
Remove Remote Config-related code after archiving.

Once a Remote Config parameter is archived, you can no longer access parameter information. Therefore, after archiving a Remote Config parameter, be sure to clean up the related code.
{% endhint %}

```javascript
// 원격 구성 정보를 담은 인스턴스를 반환합니다.
const remoteConfig = useRemoteConfig()

//remoteConfig 에서 get() 메소드를 통해 parameter 값 가져오기
const parameterValue = remoteConfig.get(parameterKey, defaultValue)

// string 유형의 parameter값 예제
const strValue = remoteConfig.get("parameterKey", "defaultValue")


// SSR 사용 시
// 원격 구성 정보를 담은 인스턴스를 반환합니다. - Loadable 사용 시
const { isLoading, remoteConfig } = useLoadableRemoteConfig()

//remoteConfig 에서 get() 메소드를 통해 parameter 값 가져오기
const parameterValue = remoteConfig.get(parameterKey, defaultValue)

// string 유형의 parameter값 예제
const strValue = remoteConfig.get("parameterKey", "defaultValue")
```

* The `parameterKey` in the `get()` method is the key configured in the Remote Config parameter settings.
* `defaultValue` is the value returned when the Remote Config value cannot be determined. The `defaultValue` you entered may be returned in the following situations: A. A value of a different type than the type configured on the Remote Config screen is entered B. An unconfigured parameter key is called C. Hackle SDK initialization failure D. Invalid or non-existent identifier information is provided E. ETC
* To correctly retrieve the configured value, you must enter a value of the type matching the parameter type you configured in `defaultValue`.
* The Remote Config parameter types provided by the SDK are string, number, and boolean. The JSON type configured on the Remote Config parameter screen can be received as a string (String). The default value for JSON type must be entered as a string type.


---

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