ConfigKey
A typed remote config key with a compiled-in default.
Unlike Novalingo's original version, this generic ConfigKey carries no built-in registry — apps own their own object AppConfigKeys { val ALL_KEYS = listOf(...) } and pass it to whatever debug override UI they build on top of RemoteConfigClient.allValues.
Construction validates that defaultValue matches valueType (and, for constrained string keys, that the default is one of allowedValues), so a mistyped key fails at startup instead of silently resolving the wrong type later. Prefer the typed factories:
object AppConfigKeys {
val NEW_ONBOARDING = ConfigKey.bool("new_onboarding", "Show the redesigned onboarding", false)
val THEME = ConfigKey.string("theme", "UI theme", "system", allowedValues = listOf("light", "dark", "system"))
val ALL_KEYS = listOf(NEW_ONBOARDING, THEME)
}Constructors
Properties
When set, the value is constrained to this fixed set of well-known choices. A debug override UI can render a dropdown instead of a free-text field. Only meaningful for ConfigValueType.STRING keys.
Functions
True when value has this key's type and, for constrained string keys, is an allowed choice.