Overview
Feature flags let you enable or disable features in your overlay without deploying a new version. Flags are managed through the Overlayed Dashboard and automatically fetched by@overlayed/app.
Registering Flags
Pass a record of flag names and their default values to thefeatureFlags option. The keys provide typed access, and
the values are used as defaults before the API responds or when a flag is missing from the response.
If a registered flag name is not found in the API response, a warning is logged to help catch typos or removed
flags.
Waiting for Flags
Theready promise resolves once the initial feature flag fetch completes, whether it succeeds or fails. Use it to
delay app startup until flags are available.
Checking Flag Status
get returns the configured default value. If no
default was registered, it returns false.
Get all flags at once:
getAll merges defaults, API values, and overrides — API values take precedence over defaults, and overrides take
precedence over both.
Listening for Changes
Feature flags are automatically fetched:- When the overlay bootstraps
- Every 10 minutes
- When a game launches or closes
Manual Refresh
Force a refresh from the API at any time:Overriding Flags
Override flag values locally. Overrides persist across API refetches and take precedence over API values. Override a single flag:Calling
override emits a change event for the flag (and the updated event) if the effective value changes. Once
overridden, subsequent API refreshes will not emit change events for that flag.Clearing Overrides
Remove an override so the flag resolves from the API value (or default) again:Clearing an override emits a change event for the flag (and the
updated event) only if the effective value
actually changes. Clearing an override that matched the underlying API value is silent.Inspecting a Flag
Get a breakdown of the individual layers that contribute to a flag’s effective value. Useful for debug panels that need to show where a value came from.undefined when it is not set, so override: false can be distinguished from “not overridden”.
