Skip to content

Feature Flags

This recipe uses the first-party remote_config module for feature flags and live tuning values.

  1. Open Modules and install remote_config.
  2. In Remote config → Configs, create configs. Each has a key and a typed value, for example new_shop_enabled = false and reward_multiplier = 1.
  3. Add overrides (on the config’s detail page or in Remote config → Overrides) to change a value for some players or for a time window. An override has a value of the config’s type, an optional segment, an optional schedule and a priority.

Rows are live as soon as you save them; you do not need a release. Configs and overrides are separate in staging and prod; promote to copy them to prod.

Generate a typed client with remote_config installed (see Generated module clients). get returns { values }: for every config key, its type (string, number, bool or json) and its value as text for the calling player. The generated file adds helpers that parse a value by key.

import { modules, remoteConfigBool, remoteConfigNumber } from './rudder.modules';
const config = await modules(client).remoteConfig.get({});
if (remoteConfigBool(config, 'new_shop_enabled') ?? false) {
showNewShop();
}
const multiplier = remoteConfigNumber(config, 'reward_multiplier') ?? 1;

A helper returns nothing (undefined or false) when the key is missing or has another type, so a default in code acts as the fallback. json values are parsed with remoteConfigJson<T> / RemoteConfigValues.TryGetJson<T>.

The SDK does not cache module results. Call get again when you want fresh values, for example at login and when returning to the main menu.

For each config, the module picks the override with the highest priority whose schedule is active (or empty) and whose segment matches the player (or is empty). If there is none, the config’s own value is used.

Examples:

  • Weekend event. Override reward_multiplier to 2 with a schedule on Saturdays and Sundays. The module’s weekend_double_rewards sample sets this up.
  • Gradual rollout. Override new_shop_enabled to true for a segment that matches part of your players.
  • Kill switch. Set the config’s value to false; clients pick it up on their next get.

An override value must have its config’s type. The dashboard rejects an override whose value does not match.