Skip to main content
The React SDK (@clubedge/feature-flags-react) provides a FeatureFlagsProvider and the useFeatureFlag() hook for client-side React applications. It wraps @clubedge/feature-flags-sdk-core and is designed for component-level conditional rendering.

Requirements

  • Any modern evergreen browser (ES2020+)
  • React 18+

Installation

Quick start

1. Create and initialize a client

2. Wrap your app with the provider

3. Evaluate flags in components

Browser (vanilla JS)

For non-React browser usage, install @clubedge/feature-flags-browser (same FeatureFlagsClient API):

Security considerations

The SDK key is bundled into client-side JavaScript and visible to anyone via browser devtools. Only use this for non-sensitive flags — UI variants, copy tests, feature tours.For sensitive flags (entitlements, kill switches, paywalled features), evaluate the flag on your backend using the Node.js SDK or Direct HTTP API, and pass only the resulting boolean to the frontend.

API reference

Like all SDKs, useFeatureFlag() returns the pre-evaluated result from GET /sdk/v1/config. The context argument does not influence per-request evaluation. Use Direct HTTP if you need per-user targeting at request time.

Next steps