# Working with remote configuration in devtodev

{% hint style="success" %}
We will greatly appreciate your feedback. Please add **REMOTE CONFIGS** when submitting your request.
{% endhint %}

**Remote Configuration** (**Remote config** or **RC**) allows you to customize the app by sending key-value pairs directly to the user’s device. These configs are defined in the devtodev interface and sent to the SDK immediately or at a scheduled time. Remote configs are stored on the devtodev servers. This allows to trigger changes in the app, without updating app versions or changing app code every time.&#x20;

{% hint style="warning" %}
**Prerequisite:**&#x20;

Currently remote configs are available only for SDK version 2.6.0 (Android & iOS), Unity 3.10.0, Web 3.0 and higher.&#x20;
{% endhint %}

## Preparation

Before using a **remote configuration** in devtodev interface, you need to set variables through the SDK and use the methods to apply new parameters. If the app is offline and will not be able to present the config to the user, they will see default values and the app will continue to function correctly.&#x20;

Integrate remote configs with devtodev SDK:&#x20;

{% content-ref url="rc-integration" %}
[rc-integration](https://docs.devtodev.com/integration/integration-of-sdk-v2/remote-configuration/rc-integration)
{% endcontent-ref %}

## How to create a remote configuration

In order to create and send a **remote configuration** to user devices, you need to set **parameter** values and define **conditions** to select the audience.&#x20;

{% stepper %}
{% step %}

### [Create conditions](#create-new-condition)

Define the audience and schedule changes
{% endstep %}

{% step %}

### [Create parameters](#create-new-parameter)

Set values and select conditions
{% endstep %}

{% step %}

### Publish changes

The configuration is finalised and sent to user devices.&#x20;

Click `Publish changes` to update the configuration.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FjUo2Er5x46K5VTjtoKMI%2Fimage.png?alt=media&#x26;token=0bf5fbb6-74ab-4f33-bff9-9b2b3f967045" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Conditions

**Conditions** define the user group (similar to a segment) that will see the modified interface. You can use basic and custom user properties, as well as previously created segments, to filter the audience.&#x20;

The order of conditions determines their evaluation sequence. The parameter value is assigned based on the first condition that evaluates to true. The condition at the top of the list has the highest priority.&#x20;

The order is important since several conditions may apply to one user. For example, <mark style="background-color:green;">**Parameter A**</mark> is sent to users from the <mark style="background-color:green;">**US that have finished 5 levels**</mark>. <mark style="background-color:red;">**Parameter B**</mark> is for users that have <mark style="background-color:red;">**completed the onboarding**</mark> (onboarding is obligatory). In this case, both parameters can apply to the <mark style="background-color:green;">**US, 5+ levels**</mark> group of users. You can change the order of the Conditions to define the parameter configuration these users will see.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FTrF82K0bh8hT1u3EQnBG%2Fimage.png?alt=media&#x26;token=75207d5f-dea1-4c85-9c33-214df992f987" alt=""><figcaption></figcaption></figure>

You can filter the conditions by selecting `Filter` in the top right corner.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FgWL4UWWsj9fHBVSV7H4Y%2Fimage.png?alt=media&#x26;token=70820db3-d359-44b1-8722-c35523048865" alt=""><figcaption></figcaption></figure>

#### Create new condition

Click `+Condition` to add a new condition. &#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FP8heK56YqJiTpgBUaBYr%2Fimage.png?alt=media&#x26;token=5aa6f02c-2ff8-4295-b5fd-969ef0a6fd21" alt=""><figcaption></figcaption></figure>

1. Configure your **condition settings**:&#x20;

* **Condition name**
* **Color** – select a color tag. You can use the color tags to organize and filter your conditions.&#x20;
* **Description** – add details about this condition and audience.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FbYJVWl9Z0W7HpnXMysJB%2Fimage.png?alt=media&#x26;token=d9ba9124-fd8d-46d7-a0ca-28bc5f3755e5" alt=""><figcaption></figcaption></figure>

2. Next, define the **Audience conditions** with user properties.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FDrdfRF2bniMGyp4cmoyL%2Fimage.png?alt=media&#x26;token=1c3f9ea1-59b1-4961-908f-d0a8b9081d2c" alt=""><figcaption></figcaption></figure>

3. Select when the new parameter value will apply to the condition audience:&#x20;

* **Permanent** – the changes will apply instantly.&#x20;
* **Scheduled** – the changed parameter value will apply only during the set time frame.&#x20;

Click `Finish` to complete condition creation.

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FWYq36tf62oqXL8xL5kfH%2Fimage.png?alt=media&#x26;token=b0e3bb3e-c46b-4636-ac6a-48cb76b4ef9c" alt=""><figcaption></figcaption></figure>

You can change the condition settings later using the `Edit` button (pencil icon) or simply by clicking on the condition card.

### Parameters&#x20;

**Parameters** represent changes in the app’s UI/UX, a configuration of the interface visible to selected users. They should be pre-implemented in the app and linked to a variable. Parameter value is stored in a key-value format, for example, “button\_color” = “green“. &#x20;

The **Parameters** section shows detailed information about all of your created parameters:&#x20;

* **Parameter** – name, value type and description.
* **Condition** – to what audience does this parameter apply.&#x20;
* **Value** – shows parameter value for each condition.&#x20;
* **Users** – how many users have this configuration.&#x20;
* **Last published** – date when the configuration was published.&#x20;

You can filter the parameters by selecting `Filter` in the top roght corner.

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2F6AYySoW9LQLOsYzgp5Lt%2Fimage.png?alt=media&#x26;token=5200c4df-e984-4ae2-805c-871267c11338" alt=""><figcaption></figcaption></figure>

#### Create new parameter

Click `+Parameter` to add a new parameter.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FA9FtuigY9LVzmJISgqDa%2Fimage.png?alt=media&#x26;token=ea4147e4-9f89-4d5a-8505-05551ede29ae" alt=""><figcaption></figcaption></figure>

Configure your **parameter settings**:&#x20;

* **Parameter name (key)** – the name should be unique and correspond to the variable in your app code.&#x20;
* **Type** – value type can be a Number, String, JSON or Boolean.&#x20;
* **Description** –  what does this parameter change in the app.&#x20;
* **Default value** – set the default value for any condition.&#x20;
  * You can use `in-app default` – in this case the parameter will use the default value define in your app code.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2Fvf4rn9c3IVDvMecLsREu%2Fimage.png?alt=media&#x26;token=4208e25d-7149-4512-ae0c-6fd6e0fbc907" alt=""><figcaption></figcaption></figure>

Next, configure **Conditional values**.&#x20;

1. Click `+Condition` and select one or multiple conditions from the list.&#x20;
2. Define a parameter value for each condition or use an `in-app deafult`.&#x20;
3. Click `Finish` to complete parameter creation.

If you do not have any created [**Conditions**](#conditions) yet, you can click `Finish` and add a condition later.&#x20;

{% hint style="info" %}
Without conditions, parameter changes will be applied to all users.&#x20;
{% endhint %}

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FtpaUTWMUbAM1InNKnAh4%2Fimage.png?alt=media&#x26;token=f69d2400-5d81-4e9e-9197-90d44cc00378" alt=""><figcaption></figcaption></figure>

You can change the parameter later using the `Edit` button in three dots menu.

#### Folders

For convenience, you can organise parameters in folders. Click `Add Folder`, give it a name and description and click `Create Folder`.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2Fg9NWYQFa8zLlOsW0XSZn%2Fimage.png?alt=media&#x26;token=dfcf7631-08f6-42d7-83a3-ad349b21f598" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FsE5H4eqz5p59LHN3qIZw%2Fimage.png?alt=media&#x26;token=f2e95102-62f4-4365-bf9f-6acbf2ea6f62" alt=""><figcaption></figcaption></figure>

You can move parameters to different folders.&#x20;

* Click on three dots on the right and click `Move to folder`, select a destination folder and click `Move`. &#x20;
* You can also move parameters in bulk: select the necessary parameters and click `Move to Folder` button in the top right corner.  &#x20;

To edit folder information, delete or ungroup a folder, select a corresponding option in the three dots menu.&#x20;

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FDaINHB9ByxB5deQyrW8A%2Fimage.png?alt=media&#x26;token=21747b26-be43-44c1-afe2-6c9a7b66195b" alt=""><figcaption></figcaption></figure>

## Changelog&#x20;

Each configuration of parameters and conditons is stored as a different version.&#x20;

You can compare the versions side by side and, if needed, `Roll back` to an old version of the configuration. Rolling back will create a new version of the config and send changes to user devices.&#x20;

<div><figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FVjOLdlHYCAwk04TPkByZ%2Fimage.png?alt=media&#x26;token=9ef46428-bb65-4821-af7c-4a3f9a8a233d" alt=""><figcaption><p>Parameters changelog</p></figcaption></figure> <figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FawbhjGHrejY75M0H8VKJ%2Fimage.png?alt=media&#x26;token=844e3fd4-a9c8-445b-9fa8-f12db796fbbd" alt=""><figcaption><p>Conditions changelog</p></figcaption></figure></div>

## Using remote configuration with A/B tests

We will add an option to send a parameter configuration directly from the A/B test page in the future updates.&#x20;

If a user enters an A/B test, they will receive parameter values according to their test group configuration.&#x20;

{% hint style="warning" %}
Parameter values received during an A/B test rewrite the default values and previously set values from the remote config. These test values **cannot be changed** until you finish the experiment (A/B test value has the highest priority).&#x20;
{% endhint %}

The priority order for parameter value source is the following:

1. **Top priority** – A/B test parameter value.
2. Remote config value from devtodev server.
3. Least priority – Default value defined in the application code.

For now, if you would like to check which parameter configuration performs better during an A/B test, you need to do the following:&#x20;

1. Before launching an A/B test, create a condition with the same audience that will be used in the test.&#x20;
2. Create a parameter configuration that you would like to test with this condition.&#x20;
3. Publish changes. The configuration will be sent to user devices.&#x20;
4. Launch the A/B test. The SDK will update the configuration on device and all events will be marked with an A/B test group. &#x20;

## Limitations

* For now, you cannot use Custom events to define a [**condition**](#conditions) audience. However, you can create a [user segment](https://docs.devtodev.com/reports-and-functionality/project-related-reports-and-fuctionality/users#segments) with the necessary event and use this segment instead.&#x20;
* You cannot see the current configuration in the user card.&#x20;
* The [changelog](#changelog) stores around 200 configuration versions.
