Experimentation Lab
Interactive implementation reference
Feature SDK implementation

React

Provider and hooks integration for reactive flag decisions in component trees.

React client

Live decision runner

Simulation mode
No credential is stored in this repo. Simulation is deterministic and clearly labeled. Add an environment SDK key to send real decisions and events; it stays in this browser’s local storage.

Implementation

Official docs ↗
npm install @optimizely/react-sdk
import { OptimizelyProvider, useDecision } from '@optimizely/react-sdk';

function Checkout() {
  const [decision] = useDecision('demo_flag');
  return decision.enabled ? <ExpressCheckout /> : <Checkout />;
}