1491b5e357
- engine/ (DagWalker, sessions, IndexedDbPlanStore) deleted; server owns the graph - trigger/callback/counter carry PendingEffect; GET /sdk/v1/scenarios/pending polled (30s jittered heartbeat paused on hidden tab + wait-deadline timers) - client.effects public API unchanged (done/buy/dismiss/end/claim/battlepass/quest) - planStateStore removed; loginEvent kept; reconcile() makes server the source of truth - generated models regenerated; skills/README/CHANGELOG updated
2.0 KiB
2.0 KiB
Remote config — client.remoteConfig
ConfigDomain<TConfig> (source: src/domains/ConfigDomain.ts, base class
src/state/RemoteConfigState.ts) — typed remote configuration as an
observable entity. Synced under revision key config.
Typed access
interface GameConfig extends Record<string, unknown> {
player_speed: number;
feature_x: boolean;
}
const client = new RudderClient<GameConfig>({ baseUrl, projectKey });
client.remoteConfig.get('player_speed', 200); // number
client.remoteConfig.get('feature_x'); // boolean | undefined
get() overloads:
get(key): TConfig[key] | undefined;
get(key, defaultValue: TConfig[key]): TConfig[key];
- Values are parsed synchronously from the loaded snapshot according to the
config's server-declared
valueType. - Returns the default value (or
undefined) while not loaded, for unknown keys, and when parsing fails. - Parsing rules:
int/integer→parseInt;float/double/number→parseFloat;bool/boolean→value === 'true';json/object→JSON.parse; anything else → raw string.
Observable
client.remoteConfig.data // Map<string, RemoteConfig> | undefined
client.remoteConfig.onChange(cb); // fires immediately
await client.remoteConfig.reload();
interface RemoteConfig {
active?: boolean; createdAt?: string; description?: string;
environment?: string; id?: string; key?: string; projectId?: string;
updatedAt?: string; value?: string;
valueType?: 'bool' | 'float' | 'int' | 'json' | 'string';
}
Only configs that are not explicitly active: false enter the map (the server
already filters inactive configs out and may omit the flag).
Behavior notes
- Warmed at login.
- Scenario
remote_config_overridenodes are applied server-side and do not reach the client. Reload or wait for the config sync poll to observe the patched value viaget(). - Without a
TConfigtype argument,RemoteConfigShapedefaults toRecord<string, unknown>andget()returnsunknown.