Core Concepts

Remote Config

Key-value configuration store with typed access, versioning, and instant updates. No user context required — configs apply globally.

Config Types

TypeExampleUse Case
string"https://api.example.com"URLs, messages, labels
number5000Timeouts, limits, thresholds
booleantrueSimple toggles without targeting
json{"primary":"#0f0"}Theme objects, complex settings

Get a Config Value

Retrieve a typed config value with a fallback default. If the key doesn't exist or the SDK isn't initialized, the default is returned.

typescript
// Typed generics
const timeout = client.getConfig<number>("api_timeout_ms", 5000);
const theme = client.getConfig<{ primary: string }>("theme_colors", { primary: "#fff" });
const message = client.getConfig<string>("welcome_msg", "Hello!");

List & Check Configs

typescript
// Get all configs as a flat map
const allConfigs = client.getAllConfigs();
// { api_timeout_ms: 5000, theme_colors: { primary: "#0f0" }, ... }

// Check if a key exists
if (client.hasConfig("maintenance_message")) {
  showBanner(client.getConfig<string>("maintenance_message", ""));
}

// List all config keys
const keys = client.getConfigKeys(); // ["api_timeout_ms", "theme_colors", ...]

Inspection

Access the raw payload metadata and environment information for debugging.

typescript
// Raw config payload
const payload = client.getPayload();
console.log(payload?.generatedAt);   // Unix timestamp
console.log(payload?.environmentId); // Environment UUID

// Environment metadata
const env = client.getEnvironment();
console.log(env?.slug); // "production"