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

# Remote Config

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

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

## remoteConfig

Calling the `remoteConfig()` method returns a `HackleRemoteConfig` instance that contains the Remote Config information for the user (configured parameters and rule information).\
`remoteConfig()` accepts user identifier information to match user properties against the Remote Config rule information.\
You can access the desired parameters and receive their values through the methods provided by `HackleRemoteConfig`.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
val user: User = Hackle.user("ae2182e0")

// Returns an instance containing Remote Config information.
val remoteConfig: HackleRemoteConfig = hackleClient.remoteConfig(user)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig


// User object — refer to the User Identifier & Properties guide
User user = User.of("ae2182e0")

// Returns an instance containing Remote Config information.
HackleRemoteConfig remoteConfig = hackleClient.remoteConfig(user);
```

{% endtab %}
{% endtabs %}

## Query Remote Config Parameters

* Since parameter values configured in the Hackle Remote Config screen are stored as key-value pairs, use the methods below according to the parameter type to retrieve the configured values.

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

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

### getString

* Returns parameter values configured as STRING or JSON type.
* Returns the default value or the value configured in a rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
val user: User = Hackle.user("ae2182e0")

// Returns an instance containing Remote Config information.
val remoteConfig: HackleRemoteConfig = hackleClient.remoteConfig(user)

val strValue: String = remoteConfig.getString("parameter_key_string_type", "defaultValue")

val jsonValue: String = remoteConfig.getString("parameter_key_json_type", "defaultValue")
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
User user = User.of("ae2182e0")

// Returns an instance containing Remote Config information.
HackleRemoteConfig remoteConfig = hackleClient.remoteConfig(user);

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

//JSON Type
String jsonValue = remoteConfig.getString("parameter_key_json_type", "defaultValue");
```

{% endtab %}
{% endtabs %}

### getInt

* Returns parameter values configured as Number type as an Int.
* Returns the default value or the value configured in a rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
val user: User = Hackle.user("ae2182e0")

// Returns an instance containing Remote Config information.
val remoteConfig: HackleRemoteConfig = hackleClient.remoteConfig(user)

val intValue: Int = remoteConfig.getInt("parameter_key_int_type", 0)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
User user = User.of("ae2182e0")

// Returns an instance containing Remote Config information.
HackleRemoteConfig remoteConfig = hackleClient.remoteConfig(user);

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

{% endtab %}
{% endtabs %}

### getDouble

* Returns parameter values configured as Number type as a Double.
* Returns the default value or the value configured in a rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
val user: User = Hackle.user("ae2182e0")

// Returns an instance containing Remote Config information.
val remoteConfig: HackleRemoteConfig = hackleClient.remoteConfig(user)

val doubleValue: Double = remoteConfig.getDouble("parameter_key_double_type", 0.0)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
User user = User.of("ae2182e0")

// Returns an instance containing Remote Config information.
HackleRemoteConfig remoteConfig = hackleClient.remoteConfig(user);

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

{% endtab %}
{% endtabs %}

### getLong

* Returns parameter values configured as Number type as a Long.
* Returns the default value or the value configured in a rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
val user: User = Hackle.user("ae2182e0")

// Returns an instance containing Remote Config information.
val remoteConfig: HackleRemoteConfig = hackleClient.remoteConfig(user)

val longValue: Long = remoteConfig.getLong("parameter_key_long_type", 0L)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
User user = User.of("ae2182e0")

// Returns an instance containing Remote Config information.
HackleRemoteConfig remoteConfig = hackleClient.remoteConfig(user);

long longValue = remoteConfig.getLong("parameter_key_long_type", 0L);
```

{% endtab %}
{% endtabs %}

### getBoolean

* Returns parameter values configured as Boolean type.
* Returns the default value or the value configured in a rule based on the state decision.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
val user: User = Hackle.user("ae2182e0")

// Returns an instance containing Remote Config information.
val remoteConfig: HackleRemoteConfig = hackleClient.remoteConfig(user)

val booleanValue: Boolean = remoteConfig.getBoolean("parameter_key_boolean_type", false)
```

{% endtab %}

{% tab title="Java" %}

```java
import io.hackle.sdk.HackleClient
import io.hackle.sdk.common.User
import io.hackle.sdk.common.HackleRemoteConfig

// User object — refer to the User Identifier & Properties guide
User user = User.of("ae2182e0")

// Returns an instance containing Remote Config information.
HackleRemoteConfig remoteConfig = hackleClient.remoteConfig(user);

boolean booleanValue = remoteConfig.getBoolean("parameter_key_boolean_type", false);
```

{% endtab %}
{% endtabs %}


---

# 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/en/development-guide/java-kotlin/java-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.
