Skip to main content

Use flags in React

Prefer explicit typed hooks

Every hook requires an explicit fallback. useFlag remains available for compatibility, but the type-specific hooks communicate intent and catch more mistakes.

Render against readiness

source: "default" means no validated remote or cached config is serving the read; the supplied fallback is authoritative.

Update targeting context

Provider props accept a stable targetingKey plus JSON-safe attributes:
Missing identity fails closed to the typed fallback. userId is a deprecated alias for targetingKey.

Generate typed hooks

The CLI can generate a TypeScript flag map from an exported configuration.

Opt in to feature telemetry

Telemetry is disabled until you configure hosted delivery, a custom transport, or a callback:
Value reads emit an exposure after a real evaluation. Details reads emit a decision without a false exposure. Record a configured outcome against the latest real exposure:
Evaluation never waits for telemetry delivery. Raw targeting keys, attributes, client keys, and evaluated values are not feature-event fields.