What is GrowthBook?
GrowthBook is an open-source feature-flagging and experimentation platform built around three core pillars.
The three pillars
Section titled “The three pillars”1. Feature Flagging
Section titled “1. Feature Flagging”Control feature visibility without requiring a new deploy. Wrap any code path behind a flag, then toggle it on or off — per environment, per audience segment, or for a percentage rollout — straight from the GrowthBook UI.
2. A/B Testing / Experimentation
Section titled “2. A/B Testing / Experimentation”Run controlled experiments to measure the real impact of your changes. GrowthBook assigns users to variants, tracks exposures via your SDK, and then queries your data warehouse to compute statistical results — including Bayesian and frequentist analyses.
3. Analytics on your own data warehouse
Section titled “3. Analytics on your own data warehouse”GrowthBook connects directly to your warehouse — Snowflake, BigQuery, Redshift, ClickHouse, and more. It queries your existing event tables and computes metrics on the fly. Your raw event data never leaves your infrastructure.
Self-host vs GrowthBook Cloud
Section titled “Self-host vs GrowthBook Cloud”| Self-Host | GrowthBook Cloud | |
|---|---|---|
| Cost | Free | Free tier, then paid |
| Data control | Full | Managed |
| Setup | Docker Compose | Sign up |
| URL | localhost:3000 | app.growthbook.io |
Key concepts
Section titled “Key concepts”| Concept | Definition |
|---|---|
| Feature | A named flag in GrowthBook that maps to a value in your code. |
| Environment | A deployment context — dev, staging, or production. Each feature can have different rules per environment. |
| SDK Connection | The pair of apiHost + clientKey that identifies your app to GrowthBook’s CDN. |
| Experiment | A controlled A/B or multivariate test linked to one or more Features. |
| Metric | A measurable outcome (conversion, revenue, latency) defined against your warehouse tables. |
Reading a JSON flag
Section titled “Reading a JSON flag”GrowthBook supports more than booleans. Use getFeatureValue to read a JSON flag with a typed fallback:
import { GrowthBook } from '@growthbook/growthbook';
const gb = new GrowthBook({ apiHost: 'https://cdn.growthbook.io', clientKey: 'sdk-YOUR_DEV_KEY',});
await gb.init({ timeout: 2000 });
// JSON flag — returns the object or the fallbackconst config = gb.getFeatureValue('checkout-config', { maxItems: 10, theme: 'light' });console.log(config.theme); // 'dark' if the flag is on, 'light' otherwiseimport { GrowthBook } from '@growthbook/growthbook';
const gb = new GrowthBook({
apiHost: 'https://cdn.growthbook.io',
clientKey: 'sdk-YOUR_DEV_KEY',
});
await gb.init({ timeout: 2000 });
// JSON flag — returns the object or the fallback
const config = gb.getFeatureValue('checkout-config', { maxItems: 10, theme: 'light' });
console.log(config.theme); // 'dark' if the flag is on, 'light' otherwise