Documentation Index
Fetch the complete documentation index at: https://growthbook-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
1. Set up Create React App
Create React App is simple to get a new project started. This guide does the standard process with one extra command to install the GrowthBook SDK and the nanoid library:http://localhost:3000/ and make sure the app is working
2. Set up GrowthBook
In this tutorial assume you are using the cloud-hosted version of GrowthBook, which is free for small teams, but you can also use the open source version and host it yourself if you prefer.GrowthBook uses the concept of Feature Flagging to run A/B tests. Basically,
you wrap the code you want to test in a conditional check
if (feature.on) ... and then you run an A/B test within GrowthBook to turn the feature on for 50% of users and off for the other 50% (or whatever percentage you like).3. Install and configure the SDK
Next, click on Step 1: Install our SDK and you should see API keys for dev/production as well as sample code. Since you already ran the npm i command at the start, you can skip that part. I’ll walk through the different parts below: First, insrc/index.js, import the GrowthBook SDK and nanoid library:
FEATURES_ENDPOINT constant above with your own dev API key you see in the GrowthBook application.
Lastly, you’ll need to wrap the app in a GrowthBookProvider component which will let us run A/B tests from anywhere in the app.
4. Create and use a feature
Now that the SDK is installed and fully integrated in our application, you can finally create theshow-logo feature.
Back in GrowthBook, Click on Step 2 of the quick start instruction or click on add new feature. Fill in the following info:
- Feature key:
show-logo - Dev: toggle on
- Prod: toggle off
- Value Type: boolean (on/off)
- Behavior: A/B Experiment
- Tracking Key:
show-logo - Sample Users based on attribute:
id - Variations and Weights: leave default (OFF/ON, 50/50 split)
- Fallback Value:
OFF
5. Analyze Results
Before you can analyze the results, you will need to connect GrowthBook to the event tracking and a data source. In the trackingCallback insrc/index.js, instead of doing a console.log, you could use Mixpanel, Rudderstack, Jitsu,
Segment or another event tracking system.
Then, throughout your app, you can similarly track events when users do something you care about, like sign up, convert, or buy something.
Once you do that, GrowthBook can connect to your event tracking system, query the raw data, run it through a stats engine,
and show you the results. Follow the directions for the data source you’re using.
Next Steps
There’s so much more you can do with GrowthBook beyond a simple on/off A/B test…- Add complex targeting and rollout rules for your features
- Read the full React SDK Docs for more details and ways to use feature flags
- Install the Chrome or Firefox DevTools Browser Extension to test different variations and scenarios
- Read about the powerful statistics engine that is used to analyze experiment results.

