> For the complete documentation index, see [llms.txt](https://wiki.playgama.com/playgama/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.playgama.com/playgama/bridge-sdk-v1/bridge-sdk/api/remote-config.md).

# Remote Config

Read game settings (difficulty, drop rates, feature flags, A/B values) from the platform at runtime. This lets you change behavior without shipping a new build. Optional; available on a subset of platforms.

Fetch once at startup before gameplay, and **always provide hardcoded defaults** for every key. The request can fail, or the platform can return only part of your config.

## Support

Check this before requesting remote values. If unsupported, use your local defaults.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.remoteConfig.isSupported
```

{% endtab %}

{% tab title="Unity" %}

```csharp
Bridge.remoteConfig.isSupported
```

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/1WdHKPqoidZK3wfuvIul" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="GDevelop" %}

<figure><img src="/files/ejSENJwwUtH3D7x08hwm" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.remote_config.is_supported
```

{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_remote_config_is_supported()
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.remote_config.is_supported()
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.remoteConfig.isSupported
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · 1 of 28 platforms</summary>

**Supports:** `yandex`

**Does not support:** `absolute_games`, `bitquest`, `crazy_games`, `discord`, `dlightek`, `facebook`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `ok`, `playdeck`, `playgama`, `poki`, `portal`, `reddit`, `samsung`, `telegram`, `tiktok`, `vk`, `xiaomi`, `y8`, `youtube`

</details>

## Load Values

Load remote values and merge them into your local defaults before gameplay starts.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
let options = { }

switch (bridge.platform.id) {
    case 'yandex':
        options = {
            clientFeatures: [ // optional parameter
                { name: 'levels', value: '5' }
            ]
        }
        break
}

bridge.remoteConfig.get(options)
    .then(data => {
        // your custom data, example: { showFullscreenAdOnStart: 'no', difficulty: 'hard' }
        console.log(data)
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```csharp
private void Start()
{
    var options = new Dictionary<string, object>();

    switch (Bridge.platform.id)
    {
        case "yandex":
            var clientFeatures = new object[]
            {
                new Dictionary<string, object>
                {
                    { "name", "levels" },
                    { "value", "5" },
                }
            };

            options.Add("clientFeatures", clientFeatures);
            break;
    }

    Bridge.remoteConfig.Get(options, OnRemoteConfigGetCompleted);
}

private void OnRemoteConfigGetCompleted(bool success, Dictionary<string, string> data)
{
    if (success)
    {
        foreach (var keyValuePair in data)
        {
            Debug.Log($"key: { keyValuePair.Key }, value: { keyValuePair.Value }");
        }
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/Jn66PDDFQyErN7SagTB5" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"yandex\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"clientFeatures.0.name\"","value":"\"level\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"clientFeatures.0.value\"","value":"\"42\""}}]},{"eventType":"block","conditions":[],"actions":[{"id":"send-remote-config-get-request","objectClass":"PlaygamaBridge"}]}]},{"eventType":"block","conditions":[{"id":"on-remote-config-got-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"},{"id":"has-remote-config-value","objectClass":"PlaygamaBridge","parameters":{"key":"\"example_key\""}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"PlaygamaBridge.RemoteConfigValue(\"example_key\")"}}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}

<figure><img src="/files/V0cEFFTWysrlsfVkwlOz" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"yandex\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"clientFeatures.0.name\"","\"level\"",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"clientFeatures.0.value\"","\"42\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::SendRemoteConfigGetRequest"},"parameters":["",""]}]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnRemoteConfigGotCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]},{"type":{"value":"PlaygamaBridge::HasRemoteConfigValue"},"parameters":["","\"example_key\"",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["PlaygamaBridge::RemoteConfigValue(\"example_key\")","\"info\"",""]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}
{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    var options

    match Bridge.platform.id:
        "yandex":
            options = {
                "clientFeatures": [
                    { "name": "player_coins", "value": "42" },
                    { "name": "player_level", "value": "dungeon_123" },
                ]
            }

    Bridge.remote_config.get(options, funcref(self, "_on_remote_config_get_completed"))

func _on_remote_config_get_completed(success, data):
    print(success)
    print(data)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    var options

    match Bridge.platform.id:
        "yandex":
            options = {
                "clientFeatures": [
                    { "name": "player_coins", "value": "42" },
                    { "name": "player_level", "value": "dungeon_123" },
                ]
            }

    Bridge.remote_config.get(options, Callable(self, "_on_remote_config_get_completed"))

func _on_remote_config_get_completed(success, data):
    print(success)
    print(data)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
var options
switch playgama_bridge_platform_id() {
    case "yandex":
        options = {
            "clientFeatures": [ // optional parameter
                { name: "levels", value: "5" }
            ]
        }
        break
}

playgama_bridge_remote_config_get(json_stringify(options))

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_remote_config_get_callback" {
    if async_load[? "success"] {
        var values = json_parse(async_load[? "data"])
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
local bridge = require("bridge.bridge")

function init(self)
    local options = {
        yandex = {
            clientFeatures = { -- optional parameter
                { name = "levels", value = "5" }
            }
        }
    }

    bridge.remote_config.get(options, function (_, data)
        -- success
    end, function ()
        -- error
    end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
let options = { }

switch (bridge.platform.id) {
    case 'yandex':
        options = {
            clientFeatures: [ // optional parameter
                { name: 'levels', value: '5' }
            ]
        }
        break
}

bridge.remoteConfig.get(options)
    .then(data => {
        // your custom data, example: { showFullscreenAdOnStart: 'no', difficulty: 'hard' }
        console.log(data)
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}
