Feature Flags
Experiments

Best 7 Optimizely alternatives for product teams

A graphic of a bar chart with an arrow pointing upward.

Product teams do not need another switchboard. They need a reliable path from an idea to a measured decision.

Optimizely is a strong feature management platform, and its experimentation product now covers A/B/n tests, warehouse-backed metrics, frequentist and Bayesian analysis, CUPED, sequential testing, mutual exclusion, and holdouts. A product team considering alternatives should not compare vendors as if Optimizely only toggles Boolean flags. The useful question is whether another operating model makes it easier for your team to define success, ship a controlled change, trust the result, and act on what it learns.

That changes the shortlist. A developer-focused flag service can be excellent software and still be a poor product-team workspace if experiment design, metrics, analysis, and product analytics live somewhere else. Conversely, an analytics suite can make insights easy to explore while falling short on server-side delivery, SDK behavior, or release governance.

This guide compares 7 credible Optimizely alternatives for product teams: GrowthBook, Statsig, PostHog, Amplitude, LaunchDarkly, Datadog Experiments, and VWO. GrowthBook is the best overall choice when teams want transparent warehouse-native experimentation with feature management. Statsig and Amplitude are compelling integrated-platform options, but their newly combined roadmap deserves diligence. PostHog is the pragmatic all-in-one choice for smaller product organizations. LaunchDarkly fits release-centric programs, VWO fits web optimization, and Datadog Experiments is strongest when warehouse metrics and operational guardrails must meet.

Start by separating web optimization from product experimentation

Optimizely can cover both, but the workflows are not identical. Web experimentation centers visual changes, pages, audiences, and conversion goals. Product experimentation centers SDK assignment, accounts or users, release flags, business metrics, and code cleanup. Product teams should inventory which mode produced real decisions in the last year before replacing the entire vendor portfolio.

A useful proof of concept gives the product manager meaningful autonomy without bypassing engineering or data safeguards. Ask the PM to create the hypothesis, choose reviewed metrics, define an audience, and interpret a result. Ask engineering to implement assignment, inspect an evaluation reason, simulate a failure, and remove the flag. Ask data to reproduce the population and primary metric outside the UI. The winning alternative should reduce handoffs while making risky decisions more explicit.

Optimizely alternatives for product teams at a glance

AlternativeBest fitProduct-team advantageMain watchout
GrowthBookCross-functional teams with governed warehouse metricsFlags, experiments, product analytics, reusable metrics, and transparent SQLRequires deliberate data and metric setup
StatsigTeams wanting flags, experiments, and analytics in one productFast self-service workflow with broad experimentation featuresAmplitude is now maintaining the platform and shaping its roadmap
PostHogStartups and compact product organizationsAnalytics, replay, surveys, flags, and experiments share one data modelUsage-based meters and lighter enterprise program governance
AmplitudeProduct teams already standardized on Amplitude AnalyticsBehavioral cohorts and analytics connect directly to experimentsAdvanced packaging and the Statsig integration roadmap need validation
LaunchDarklyProduct teams embedded in mature release engineeringFeature lifecycle, controlled rollout, experiments, and kill switchesRelease-first center of gravity and several usage meters
Datadog ExperimentsData-led teams connecting business and reliability outcomesWarehouse metrics plus observability guardrailsHigh published entry price and an evolving Eppo-to-Datadog transition
VWOProduct and growth teams with a strong web optimization programFeature tests, visual testing, behavior insights, and program planningBest value often depends on combining multiple VWO products

The ranking emphasizes product-team work, not the longest feature checklist. We weighted the path from hypothesis to decision, metric governance, experimentation depth, audience and cohort reuse, cross-functional usability, feature delivery, implementation transparency, and the predictability of the commercial model.

What product teams should compare beyond feature flags

The metric system is part of the product

A product manager needs to specify a primary outcome, guardrails, segments, and a decision rule before an experiment launches. If each team rebuilds “activation,” “retention,” or “revenue” inside a different vendor, the organization can get technically valid results that still disagree with its dashboards and finance definitions.

Ask where metrics are computed and governed. Warehouse-native systems query source-of-truth tables. Event-native systems ingest behavioral data and make exploration fast. Both can work. The failure mode is adopting a platform without deciding which system owns identity joins, late-arriving data, bot filtering, attribution windows, currency conversion, and metric versioning.

Statistical features matter too, but they should serve decisions. Sample ratio mismatch detection can reveal assignment or exposure problems. Variance reduction can shorten tests when pre-experiment behavior predicts the outcome. Sequential methods can support valid monitoring before a fixed horizon. Mutual exclusion and holdouts help teams reason about simultaneous changes. These are not badges; each feature should map to a recurring product decision.

Use established methods to pressure-test vendor language. Microsoft Research's work on online controlled experiments shows why trustworthy experimentation depends on organizational and engineering systems, not only a statistics engine. The original CUPED paper explains the assumptions behind a commonly advertised variance-reduction feature, while Microsoft's guidance on diagnosing sample ratio mismatch shows that an imbalance is a data-quality warning, not a result to explain away. For classical test design, the NIST experimental design handbook and the American Statistical Association's statement on p-values are useful checks against a dashboard that reduces uncertainty to one colored badge.

Collaboration starts before the results page

The product workflow includes intake, hypothesis review, design, instrumentation, launch criteria, QA, traffic ramping, monitoring, analysis, and a final decision. A polished result chart does not fix weak instrumentation or an experiment that began without a falsifiable hypothesis.

Evaluate templates, metric libraries, ownership, comments, approvals, change history, notifications, and the ability to link experiment records to the roadmap. Product, engineering, design, and data roles should be able to contribute without sharing a single administrator account. Enterprise controls are useful only if they support the workflow instead of turning every test into a ticket queue. The open-source GrowthBook product analytics layer is one example of connecting discovery and experimentation without hiding how results relate to source data.

Delivery and learning need one identity contract

Flag evaluation and experiment analysis must agree about who received which variant. During a proof of concept, verify the randomization unit, stable identifier, anonymous-to-known-user transition, group-level assignment for B2B accounts, exposure timing, and behavior across devices. The OpenFeature specification can reduce application-level coupling to a flag provider, but it does not standardize your experiment metrics or repair an inconsistent identity model.

Optimizely itself remains a legitimate baseline. Its current plans and packaging are individually packaged and generally quote based. Web Experimentation, Feature Experimentation, analytics, personalization, collaboration, support, and implementation services can create different contract lines. Compare the cost of the complete workflow rather than treating one product quote as the cost of the portfolio.

1. GrowthBook: Best overall for product teams

Best for

GrowthBook is the strongest Optimizely alternative for product organizations that want feature delivery, rigorous experimentation, and product analytics connected to the same governed data. It fits particularly well when product metrics already live in Snowflake, BigQuery, Databricks, Redshift, ClickHouse, or another warehouse and data teams want results that can be inspected rather than accepted as a black box.

Key strengths

GrowthBook Experimentation lets teams define reusable metrics, dimensions, guardrails, experiment templates, and analysis settings. It supports Bayesian and frequentist engines, sequential testing, CUPED variance reduction, sample ratio mismatch checks, holdouts, mutual exclusion, and power calculations. Product managers get a guided experiment workflow, while data scientists can inspect queries and advanced settings.

The warehouse-native architecture is the central product-team advantage. GrowthBook queries the data where it already lives and exposes the SQL behind results. A team can use revenue, retention, cost, operational quality, or domain-specific measures without rebuilding every definition as a vendor event. For organizations with an established semantic layer, that makes experimentation part of the existing data contract.

GrowthBook Feature Flags connects rollout and measurement. Teams can target users, ramp traffic, use multiple environments, preview rules, and convert a release into an experiment. The open-source GrowthBook repository and SDKs make the implementation visible, and cloud or self-hosted deployment preserves architectural choice.

Product analytics now sits alongside flags and experiments. That gives product teams a place to explore behavior and identify opportunities without separating discovery from the governed metrics used in tests. The platform still leaves room for a dedicated BI or analytics stack; it does not require a wholesale data migration.

Watchouts

GrowthBook rewards teams that invest in clean identities, trustworthy source tables, exposure logging, and a shared metric library. Connecting a warehouse is more deliberate than pasting a lightweight client analytics snippet. A small team with no data model may get to exploratory funnels faster in an event-native product.

The free cloud workspace is intentionally compact, and advanced permissions, approval workflows, larger project structures, premium support, or managed-warehouse scale can require paid plans. Self-hosting changes subscription costs but transfers availability, upgrades, backups, security, and support to your team.

Pricing and implementation notes

The current GrowthBook pricing page lists a free Starter plan for up to 3 users and 1 project with unlimited feature flags, experiments, and core traffic. Pro is listed at $40 per seat per month and adds advanced statistics, analytics, permissions, and release capabilities; Enterprise is custom. The self-hosted free plan supports unlimited users, while paid self-hosted tiers add commercial controls and support.

Pilot one real roadmap decision. Connect the metric source, define an activation or retention measure, ship one change behind a flag, inspect the generated SQL, and have product, engineering, and data stakeholders independently reproduce the interpretation. That tests the operating model instead of merely proving an SDK can return a value.

2. Statsig: Best integrated experimentation workflow

Best for

Statsig is a strong fit for product teams that want feature gates, dynamic configuration, experiments, product analytics, session replay, and a broad metric catalog in a single interface. It is especially appealing when a team values rapid self-service and is comfortable with an event-based platform or Statsig's warehouse-native deployment.

Key strengths

Statsig links gates and dynamic configs to experiments, so teams can move from a staged release to measurement without stitching together assignment logic manually. Its platform includes A/B and multivariate experiments, scorecards, guardrails, segments, holdouts, sequential testing, variance reduction, and product analytics. The Statsig platform documentation describes both Statsig Cloud and warehouse-native operating models.

The product-team benefit is breadth with a coherent workflow. A PM can define an experiment, reuse metrics, inspect segment results, and coordinate with engineers who manage gates and configs. Data scientists can work with advanced statistics and warehouse data, while analysts can explore behavioral results. The open-source Statsig SDK repositories provide implementation visibility across common languages and frameworks. Teams adopting a provider abstraction can also review the vendor-neutral OpenFeature specification repository instead of treating an adapter as proof of portability.

Statsig's free Developer plan is substantial enough for a cross-functional proof of concept, and its unlimited-seat positioning removes pressure to restrict product, design, or data collaborators during evaluation. That matters because a platform cannot become a shared decision record if most of the team only receives screenshots.

Watchouts

Statsig's ownership context changed twice in a short period. OpenAI announced its acquisition of Statsig in September 2025, saying the platform would continue operating independently. In May 2026, Amplitude announced a strategic partnership under which Amplitude took on the Statsig brand and customers and committed to maintain and develop the current cloud and warehouse platforms.

That is not evidence that the product is unavailable; the current platform and pricing remain active. It is a reason to ask roadmap questions. During procurement, confirm SDK support, data residency, contract entity, support ownership, migration commitments, overlapping Amplitude products, and which features are planned to converge. Existing customers need continuity answers, while new customers need a clear picture of the destination architecture.

Pricing and implementation notes

The current Statsig pricing page lists a free Developer plan with 2 million events per month, unlimited flag and config checks, core experiments, feature flags, product analytics, and unlimited seats. Pro is listed from $150 per month with 5 million included events and usage beyond the allowance; Enterprise and warehouse-native packages are custom.

Run the proof of concept against the deployment mode you would actually buy. Event-cloud and warehouse-native systems can look similar in a demo while creating different ownership, latency, governance, and cost models. Ask the vendor to diagram how identity, exposures, metrics, and results move through the planned post-partnership architecture.

Compare beyond feature flags

See how GrowthBook and Optimizely differ across experimentation, warehouse data, deployment control, and pricing.

Compare the Platforms

3. PostHog: Best all-in-one choice for smaller product teams

Best for

PostHog is best for startups and compact product organizations that want product analytics, web analytics, session replay, surveys, feature flags, experiments, and a data warehouse in one toolkit. It can replace several point products and gives a PM multiple forms of evidence without waiting for a large data-platform project.

Key strengths

PostHog's advantage is contextual breadth. A product team can see a funnel drop, inspect related session recordings, survey an affected cohort, ship a fix behind a flag, and measure the experiment inside the same data model. That is valuable during discovery, when the team does not yet know whether the problem is behavioral, technical, or perceptual.

The PostHog experiments documentation connects variant assignment, exposure, goal metrics, secondary metrics, trends, funnels, and statistical results. Its feature flag system supports targeted releases and remote configuration across supported SDKs. The open-source PostHog repository makes a large part of the platform inspectable, and PostHog publishes its product and company practices unusually openly.

PostHog also has a low-friction commercial entry point. Unlimited team members on the free and pay-as-you-go plans make it practical to include product, engineering, design, support, and data colleagues. Per-product billing limits can reduce surprise costs during a pilot.

Watchouts

An all-in-one product creates its own tradeoffs. Product teams must decide whether PostHog's event model should become the source of truth for experiment metrics or whether warehouse-backed business definitions need additional integration. Advanced experimentation-program governance, highly customized statistical workflows, and formal enterprise approvals may not match specialists designed around large centralized programs.

Usage pricing also spans multiple meters. A successful pilot can increase analytics events, feature-flag requests, recordings, survey responses, and warehouse activity together. Estimate the combined product footprint instead of treating the flag line item as the full cost.

Pricing and implementation notes

The current PostHog pricing page lists monthly free allowances including 1 million product analytics events, 1 million feature flag requests, and 5,000 session recordings. Experiments are billed with feature-flag usage. The free plan includes 1 project, 1-year retention, and unlimited team members; adding a payment method unlocks pay-as-you-go use, more projects, longer retention, and email support.

For the pilot, trace one product question across the suite: identify a behavioral problem, inspect qualitative evidence, create a cohort, release a variant, and verify that exposure and outcome data use the expected identities. That tests PostHog's consolidation value more honestly than comparing its flag screen alone.

4. Amplitude: Best for teams already using Amplitude Analytics

Best for

Amplitude is the natural Optimizely alternative for product teams already standardized on Amplitude Analytics and its behavioral cohorts. It brings product analytics, feature experimentation, feature flags, web experimentation, replay, guides, and surveys into one platform, reducing the number of identity and audience integrations a team must maintain.

Key strengths

Amplitude Feature Experiment supports client-side and server-side flags, A/B and multivariate tests, multi-armed bandits, payloads, targeting, and experimentation across web, mobile, and backend applications. Product teams can build audiences from behavioral data and use the same analytics context to understand why a result differs by segment.

That shared context is the main reason to choose Amplitude. A PM can move from a funnel or retention analysis to an eligible cohort, run a test, inspect segment differences, and continue the analysis without exporting every result into another tool. The Experiment quick start also exposes important assignment choices such as the randomization unit and stable bucketing salt instead of hiding them behind a visual workflow.

Amplitude maintains SDKs in public GitHub repositories, and Feature Experiment supports local and remote evaluation patterns across supported stacks. Separate Web Experimentation adds a visual editor for website changes, which can help product-led growth teams run low-code surface experiments while engineers retain control of deeper application work.

Watchouts

Amplitude's breadth can be an advantage or a packaging puzzle. Free access includes limited experimentation, while advanced analytics, permissions, dedicated experimentation capacity, or enterprise controls can require higher plans or add-ons. Confirm the exact limits on concurrent experiments, feature experimentation, web impressions, data retention, and warehouse integration rather than inferring them from the phrase “full platform.”

The Statsig partnership creates a second evaluation question. Amplitude says it will maintain the existing Statsig platforms while developing a more integrated roadmap. If both products make your shortlist, ask for a concrete boundary: which SDK, metric system, analysis interface, and contract is the long-term recommendation for a new implementation like yours?

Pricing and implementation notes

The current Amplitude pricing page lists a free plan with 2 million events per month, unlimited seats, product analytics, session replay, feature flags, and limited experiments. Plus starts at $0 for the first 2 million events and scales with volume; Growth and Enterprise use custom event-based pricing and add governance and advanced analysis capabilities.

Use an existing trusted Amplitude cohort in the pilot, but do not skip identity validation. Confirm assignment before exposure, company-level bucketing if you sell B2B, anonymous-to-authenticated behavior, and the events that count toward billing. Product-team convenience is valuable only if the resulting experiment remains statistically and operationally sound.

5. LaunchDarkly: Best for release-centric product teams

Best for

LaunchDarkly fits product organizations whose experiments are tightly coupled to mature feature delivery. It is strongest when engineers need broad SDK coverage, progressive rollout, approvals, scheduling, operational controls, and kill switches across many services and teams.

Key strengths

LaunchDarkly Experimentation attaches metrics and randomized tests to the feature-management control plane. Teams can deploy code behind a flag, target an internal audience, run an experiment, ramp the winning treatment, and retain an emergency off switch through one release path.

The mature SDK and governance ecosystem is the differentiator. Product teams operating inside a large engineering organization can reuse environments, roles, workflows, audit history, and release automation. Local SDK evaluation supports backend, web, mobile, and edge applications without requiring a network request for every decision.

Watchouts

LaunchDarkly is not a visual web-optimization suite in the same shape as Optimizely Web Experimentation. If product managers or marketers need to author browser changes without an application release, keep VWO, Kameleoon, or another visual candidate in the evaluation. Likewise, determine where business metrics, exposures, and long-term analysis will live.

Release power can create a large control plane. Test flag ownership, expiration, code references, approval bypasses, context privacy, and the process that removes a completed experiment from code. A fast rollout interface does not prevent flag debt.

Pricing and implementation notes

LaunchDarkly's current pricing includes a free Developer plan, usage-based Foundation packaging, and custom Enterprise terms. Enterprise adds advanced roles, approvals, workflows, and release automation; Guardian is a paid release-safety add-on. Model service connections, client-side MAU, experimentation MAU, observability, support, and the real application topology.

Pilot one account-level experiment with a guarded rollout and rollback. Compare evaluation behavior, exposure timing, metric reconciliation, permissions, and the cleanup path with the current Optimizely workflow.

6. Datadog Experiments: Best for warehouse and observability guardrails

Best for

Datadog Experiments is best for mature data-led product teams that want source-of-truth warehouse metrics and operational telemetry in the same decision. It is particularly relevant for backend, infrastructure, pricing, marketplace, and AI changes where latency, error rate, model quality, or compute cost must be evaluated alongside user and revenue outcomes.

Key strengths

Datadog Experiments is the successor to Eppo inside Datadog. It combines warehouse-native metrics, reusable definitions, experiment analysis, product analytics, feature flags, and observability guardrails. The product supports sequential and fixed-horizon methods, Bayesian analysis, variance reduction, sample ratio mismatch detection, and decision workflows.

The cross-functional value is the connection between product impact and system behavior. A PM can evaluate conversion or retention while engineering watches errors, latency, traces, and infrastructure cost. This is useful for AI products, where a variant may improve engagement but increase model spend or failure rates. The OpenTelemetry semantic conventions provide a useful independent reference when evaluating whether operational guardrails rely on portable telemetry or proprietary event definitions.

Datadog acquired Eppo in May 2025, and the underlying experimentation lineage is credible. Eppo's SDK work remains visible in the public GitHub organization, which gives technical evaluators another place to review implementation patterns while the Datadog-native products evolve.

Watchouts

The product is in an active transition. Datadog is migrating Eppo customers while building its own Feature Flags and Experiments products. Confirm the migration path, API and SDK compatibility, warehouse integrations, historical results, contract terms, and whether a capability shown in Eppo documentation is available in the Datadog product you would buy today.

Datadog also has the highest explicit entry cost in this shortlist. Its per-successful-experiment unit may suit a high-value, lower-volume program, but it can be counterproductive if product teams are trying to run many exploratory tests. Define what counts as billable and model inconclusive, stopped, low-traffic, and repeated experiments.

Pricing and implementation notes

The current Datadog pricing page lists Experiments from $450 per successfully launched experiment per month on an annual plan, or $575 on demand. Datadog describes an experiment as billable once it reaches at least 500 subjects and runs for at least 3 days, with included credits toward feature flags, product analytics, RUM, and session replay. Verify the exact current bundle against your Datadog contract.

Pilot a change with competing product and operational outcomes. For example, test a new recommendation model using conversion as the primary metric, latency and error rate as guardrails, and compute cost as a decision input. That shows whether the platform genuinely improves cross-functional decisions rather than only adding another experiment results page.

7. VWO: Best for product teams with a strong web program

Best for

VWO is best for product and growth teams whose experimentation program spans application features, marketing surfaces, personalization, behavior research, and idea management. It is a better Optimizely alternative when visual web experimentation and conversion optimization are as important as SDK-based feature delivery.

Key strengths

VWO Feature Experimentation supports flags, variables, targeted rollouts, A/B/n tests, multivariate tests, multi-armed bandits, guardrails, holdouts, scheduling, and multiple environments. Its SDKs are available across common languages, and the VWO GitHub organization lets engineers review supported integrations and open-source client components.

The broader suite brings together VWO Testing, Insights, Personalize, and Plan. Product teams can use heatmaps, recordings, surveys, and analytics to generate hypotheses, organize them in a program backlog, then run visual or feature experiments. VWO Plan is specifically designed for collaborative idea intake, prioritization, and experiment tracking, which can help a center of excellence manage work across teams.

VWO is also approachable for non-engineering contributors. A visual editor and behavior tools let growth, marketing, and design teams investigate and test some web changes without making every iteration an application release. Engineering can reserve SDK-based experiments for deeper product behavior.

Watchouts

VWO's value depends on which products you combine. A team may need Feature Experimentation for application code, Testing for visual web changes, Insights for behavior evidence, and Plan for program management. Validate data sharing, identity, permissions, and pricing across the exact suite rather than evaluating each module in isolation.

The platform's breadth also makes it easy to mix optimization methods without a shared metric contract. A visual web test, a feature experiment, and a personalization campaign can expose overlapping audiences. Check how VWO handles mutual exclusion, holdouts, cross-product collisions, and result reconciliation for your planned package.

Pricing and implementation notes

The current VWO pricing page presents Growth, Pro, and Enterprise tiers for Feature Experimentation but requires a demo or quote for commercial pricing. Growth includes 10 feature flags, 3 environments, rollouts, and core tests; Pro and Enterprise add unlimited flags, variables, environments, advanced targeting, multivariate tests, bandits, and enterprise service or governance features.

Build a pilot that crosses the boundary you care about: use behavior evidence to form a hypothesis, log it in the program workflow, run a server-side or feature test, and inspect how the result connects back to the original evidence. If the handoffs remain manual, price the suite as several tools rather than one platform.

How to choose the right alternative for your product operating model

Choose GrowthBook when governed metrics are the center

GrowthBook is the clearest fit when product, engineering, and data teams agree that experiment results should use warehouse metrics and transparent queries. It gives teams a direct path from feature flags to rigorous analysis without requiring them to surrender their source-of-truth data model. It is also the only option in this shortlist that combines this workflow with a fully open-source platform and both cloud and self-hosted deployment.

Choose an integrated event platform when speed of exploration is the center

Statsig, PostHog, and Amplitude reduce the distance between behavioral analysis, cohorts, flags, and experiments. Statsig offers a deep dedicated workflow with cloud and warehouse modes, though its Amplitude transition needs contractual clarity. PostHog gives smaller teams the broadest product toolkit with transparent usage pricing. Amplitude is strongest when the company already trusts its analytics taxonomy and cohorts.

Choose a broader optimization suite when web and program operations are the center

LaunchDarkly makes sense when product experimentation is attached to mature feature delivery, approvals, release automation, and operational controls. VWO makes sense when visual editing, personalization, behavioral research, and web-program operations dominate. Treat them as different operating models rather than one multi-channel category.

Choose Datadog when operational evidence belongs in the decision

Datadog Experiments stands out when every experiment needs to connect business metrics with reliability, performance, or AI-system economics. Its entry price means the value case should be explicit. It is better suited to consequential experiments than to an organization trying to make every minor UI change a low-cost test.

A practical proof of concept for product teams

Do not run 7 unrelated demos. Give finalists the same product decision and ask each platform to complete the same workflow.

  1. Write a falsifiable hypothesis and name one primary metric, 2 guardrails, the randomization unit, minimum detectable effect, target segment, duration rule, and owner.
  2. Implement one low-risk multivariate configuration behind a flag in development and production environments. Confirm safe defaults when configuration is unavailable.
  3. Assign by a stable user or account identifier. Test anonymous, authenticated, multi-device, and B2B group behavior where applicable.
  4. Validate exposures and outcomes against raw data. Trigger an intentional sample imbalance in a test environment and verify whether the platform detects it.
  5. Invite a PM, engineer, designer, analyst, and approver. Have each role complete its normal work without elevated access.
  6. Ramp from an internal cohort to a small production audience. Test pause, rollback, approval, audit, and notification behavior.
  7. Interpret an inconclusive result. A useful platform should help the team resist a false winner, not merely produce a green arrow.
  8. Estimate annual cost at current scale and at 5 times current traffic, experiments, seats, projects, data retention, and support needs.

Independent review pages such as G2's Optimizely Web Experimentation alternatives and practitioner discussions about mid-market Optimizely alternatives can surface implementation questions, but they should not replace direct validation. Reviews reflect different plans, dates, team sizes, and technical architectures. Use them to build test cases, then verify those cases in your own proof of concept.

The final decision should identify an operating model, not a favorite interface. Document which system owns assignment, exposures, metrics, analysis, approvals, and the decision record. Name who will maintain SDKs, data quality, templates, and stale flags. A platform succeeds when those responsibilities become clearer and learning gets more reliable—not when the vendor demo has the most screens.

For teams that want product managers to learn from warehouse metrics while engineers retain high-performance feature delivery, GrowthBook is the strongest overall Optimizely alternative. Its combination of open-source control, transparent SQL, reusable metrics, rigorous statistics, product analytics, and predictable seat-based pricing supports both the first pilot and a scaled experimentation program. If you want to validate the fit with your data and workflow, start with GrowthBook or book a product-team demo.

Test your product workflow

Connect your data, ship a controlled change, and measure the result with feature flags and experimentation in one platform.

Start with GrowthBook

Table of Contents

Related Articles

See All Articles
Feature Flags
Experiments

Add local feature flags to a React app with TypeScript

Nov 20, 2026
x
min read

A magazine's home page shows two recent issues. The design team wants subscribers to try a shelf with four. All four covers are public, and changing editions while the page is open should update the shelf immediately. That gives you a small React feature with a useful acceptance test. Click from guest to subscriber and back, and count the covers each time.

We'll put the display limit in a typed local flag, evaluate it inside a React component, and leave the choice of edition with the app. The example runs in a client-rendered React app without a GrowthBook account, an SDK key, or a request for flag rules. For the wider workflow, free feature flags for coding agents explains what to ask an agent to implement and how to review the result.

Define what one flag controls

Start with an existing React and TypeScript app, or create a Vite React project for the example. Install both GrowthBook packages so the definitions and the hooks resolve against compatible SDK versions.

npm create vite@latest issue-shelf -- --template react-ts
cd issue-shelf
npm install
npm install @growthbook/growthbook@^2.2.0 @growthbook/growthbook-react@^2.2.0

Create src/flags.ts. Here the feature value is a number, which lets the component use the same rendering code for either edition. A future change from four covers to three is one edit to the rule.

import type { LocalFeatures } from "@growthbook/growthbook";

export type Edition = "guest" | "subscriber";
type Features = { issueLimit: number };
type Attributes = { id: string; edition: Edition };

declare module "@growthbook/growthbook" {
  interface Register {
    features: Features;
    attributes: Attributes;
  }
}

export const features: LocalFeatures = {
  issueLimit: {
    defaultValue: 2,
    rules: [
      { condition: { edition: "subscriber" }, force: 4 },
    ],
  },
};

A guest falls through to the default of two. A subscriber matches the rule and gets four. This rule applies to every subscriber, so the ID has no effect on the result here. If you later roll the shelf out to a percentage of subscribers, you already have an identity to use for repeatable assignment.

The type registration release note explains the version requirement for LocalFeatures. The registration connects the definition, the attributes, and the value returned by the hook. For the TypeScript mechanics, see Jeremy Dorn's Register pattern walkthrough.

Put the current reader above the shelf

Replace src/App.tsx with the component below. The edition switch is a local fixture so anyone reviewing the change can reproduce both states. In an existing app, take those two values from the active reader in your session layer.

import { useMemo, useState } from "react";
import { GrowthBook, GrowthBookProvider } from "@growthbook/growthbook-react";
import { features, type Edition } from "./flags";
import { IssueShelf } from "./IssueShelf";

export default function App() {
  const readerId = "reader-17";
  const [edition, setEdition] = useState<Edition>("guest");

  const gb = useMemo(() => new GrowthBook({
    attributes: { id: readerId, edition },
    defaultHashVersion: 2,
  }).initSync({ payload: { features } }), [readerId, edition]);

  return (
    <GrowthBookProvider growthbook={gb}>
      <main>
        <h1>Recent issues</h1>
        <p>Current edition: {edition}</p>
        <button onClick={() => setEdition(
          edition === "guest" ? "subscriber" : "guest"
        )}>
          Switch edition
        </button>
        <IssueShelf />
      </main>
    </GrowthBookProvider>
  );
}

The provider receives an instance initialized with the current reader and the checked-in rules. React can render the correct shelf on the first pass for that reader. If the app is still loading a session, decide what should occupy the shelf in the meantime. For this public list a two-cover guest view is reasonable. On a page where a switch would interrupt the reader, wait for the session before mounting the shelf.

Give your agent the React setup

Use the local flags guide to ask for a typed definition, a provider with the current reader, and a test that changes the edition.

Open the Agent Guide

The useMemo dependencies include the ID and the edition. If a reader subscribes while signed in, their ID can stay the same while their edition changes. Depending only on the ID would leave the old SDK instance in place. Passing a fresh object as the dependency on every render would create unnecessary instances. The example uses the two primitive values the rule setup actually needs.

Read the numeric flag where React renders the list

Create src/IssueShelf.tsx. Keep one stable ID per issue and let the component use the resolved value to select how many items to render.

import { useFeatureValue } from "@growthbook/growthbook-react";

const issues = [
  { id: "nov", title: "November · Print shops" },
  { id: "oct", title: "October · Bookbinders" },
  { id: "sep", title: "September · Type designers" },
  { id: "aug", title: "August · Paper mills" },
];

export function IssueShelf() {
  const limit = useFeatureValue("issueLimit", 2);

  return (
    <ul aria-label="Recent magazine issues">
      {issues.slice(0, limit).map(issue => (
        <li key={issue.id}>{issue.title}</li>
      ))}
    </ul>
  );
}

Keep the hook at the top of the component, inside the provider's subtree. The React SDK supplies the flag value through that provider. Calling a hook inside a click handler or inside the list loop would break the Rules of Hooks. Use the returned number in ordinary render logic.

There are two places you can see the number two in this implementation. The definition's defaultValue is what an ordinary guest gets through evaluation. The 2 passed to the hook is a fallback for a value the SDK can't supply. Giving them the same value makes the basic shelf a sensible fallback, but checking only the guest case would let a broken provider arrangement or missing definition go unnoticed. The subscriber case proves that the component actually received the rule.

The list keys identify magazine issues. Keep those keys independent of the flag. Switching from two covers to four should preserve the identity of the first two rows. There's also no need to remount the whole app with an edition-specific key. React preserves state according to component position and keys. For example, a search input outside the shelf shouldn't lose its text because someone subscribed.

Check the transition in both directions

Use the template's build script to type-check and bundle the app. Once that passes, start the dev server and open the local address it prints.

npm run build
npm run dev

On first load, the page says guest and lists November and October. Click Switch edition. The same page should say subscriber and add September and August. Click again. The list should return to the original two issues, in order. This last check catches code that appends more results on upgrade and never removes them on downgrade.

For a compile-time check, temporarily replace the numeric fallback with the string "2". Run the build again and inspect the error on the hook call. Then restore 2 and rebuild. If the string compiles, check that src/flags.ts belongs to the same TypeScript project as the component and that the package manager resolved compatible core and React versions.

npm ls @growthbook/growthbook @growthbook/growthbook-react

Look for the core package used by your app and by the wrapper. If the app has several incompatible installations, align the versions before diagnosing the JSX. A team using an existing build script should also confirm it actually runs the TypeScript checker.

Hand off a React change someone can review

Give your coding agent the one-shot local feature flags guide and a short description of the observable behavior. For this shelf, the request can be as specific as the test.

Show two public issues to guests and four to subscribers.
Keep the same reader ID when switching editions in the test.
Report the initial titles, the titles after upgrading, and the titles
after switching back. Include the type-check command you ran.

The shelf controls how many public titles to display. If your actual feature unlocks paid articles, enforce access when the server serves an article. A client-rendered flag only decides what to show in that browser. Whenever a change to the display limit can wait for a deployment, the small local file keeps the decision reviewable alongside the component. When an editor needs to change it between issues without an engineering release, compare the free GrowthBook options for managing flag rules.

Manage the shelf in GrowthBook

Start a GrowthBook workspace when your magazine team is ready to manage shelf rules between deployments.

Get Started with GrowthBook
Feature Flags
Experiments

Use local feature flags per request in Node.js

Nov 20, 2026
x
min read

Two customers download the same weekly report. One has agreed to preview a new CSV column. The other feeds the old two-column format into an importer. Both requests can land on the same Node.js process, and each needs the right file even if the other request arrives while the report is loading.

This tutorial builds that endpoint with one checked-in feature flag. The process loads the rules once. Each request supplies its own workspace attributes and receives its own evaluation. You can run the whole example on your machine without an account, a client key, or a flag server. The free feature flags for coding agents walkthrough introduces the local approach. Here we'll give the agent a server-specific test to pass.

Set up a small TypeScript service

Use Node.js 22 or newer for this example. In an empty directory, create an npm project that uses ES modules, install the core SDK, and add the TypeScript tools.

npm init -y
npm pkg set type=module
npm install @growthbook/growthbook@^2.2.0
npm install -D typescript tsx @types/node@22

Create tsconfig.json at the project root. The sample runs TypeScript directly with tsx and checks types in a separate step. Type checking with tsx explains why the two commands serve different purposes.

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "strict": true,
    "noEmit": true,
    "skipLibCheck": true,
    "types": ["node"]
  },
  "include": ["*.ts"]
}

The following files all live next to that configuration. The server imports ./flags.js even though the source file is flags.ts. That spelling follows TypeScript's Node.js module resolution for ESM and works with this runner.

Define the report contract in one flag

Create flags.ts. The public format has two columns. The sample preview workspace gets one additional column. The only targeting attribute the rule needs today is reportPreview. Carry the workspace ID too, so two people downloading a report on behalf of the same workspace can share an assignment if you introduce a percentage rollout later.

import type { LocalFeatures } from "@growthbook/growthbook";

type Features = { includeUniqueReaders: boolean };
export type Workspace = { workspaceId: string; reportPreview: boolean };

declare module "@growthbook/growthbook" {
  interface Register {
    features: Features;
    attributes: Workspace;
  }
}

export const features: LocalFeatures = {
  includeUniqueReaders: {
    defaultValue: false,
    rules: [{ condition: { reportPreview: true }, force: true }],
  },
};

The SDK type registration update covers this rule syntax and the 2.2.0 minimum. If you misspell reportPreview in a condition or use a string where the boolean flag expects a value, TypeScript can point at the definition. The Register pattern also makes the same feature name available in other modules without threading a generic type through each handler.

Before you add the endpoint, decide what belongs to the process and what belongs to the request. The feature definitions are identical for both customers. Their identity and preview enrollment can differ. If a handler changes an attribute on a single shared user instance before awaiting a database query, another handler could replace that attribute before the first handler resumes.

Give your agent a server-side task

Use the one-shot guide to add checked-in rules. Ask your agent to keep workspace attributes local to each request and demonstrate both CSV formats.

Open the Local Flags Guide

Create a scope when the request arrives

Create server.ts. The Node.js SDK provides GrowthBookClient for the process and createScopedInstance for the current request. The two fixture paths below stand in for two authenticated workspaces. The server binds to the loopback address so you can exercise it locally.

import { createServer } from "node:http";
import { setTimeout as delay } from "node:timers/promises";
import { GrowthBookClient } from "@growthbook/growthbook";
import { features, type Workspace } from "./flags.js";

const client = new GrowthBookClient({ defaultHashVersion: 2 })
  .initSync({ payload: { features } });

const demos = new Map<string, Workspace>([
  ["/demo/preview", { workspaceId: "press-a", reportPreview: true }],
  ["/demo/standard", { workspaceId: "press-b", reportPreview: false }],
]);

createServer(async (req, res) => {
  const workspace = demos.get(req.url ?? "");
  if (req.method !== "GET" || !workspace) {
    res.writeHead(404).end();
    return;
  }

  const gb = client.createScopedInstance({ attributes: workspace });
  await delay(10); // Stand-in for loading this workspace's report.
  const expanded = gb.isOn("includeUniqueReaders");
  const csv = expanded
    ? "period,downloads,unique_readers\nweek-1,80,55\n"
    : "period,downloads\nweek-1,80\n";

  res.writeHead(200, {
    "Content-Type": "text/csv; charset=utf-8",
    "Cache-Control": "private, no-store",
  });
  res.end(csv);
}).listen(4178, "127.0.0.1", () => {
  console.log("Report server listening on http://127.0.0.1:4178");
});

The HTTP handler looks up a workspace, creates its scope, and holds that scope across an asynchronous operation. The short promise-based timer gives a second request time to arrive. In a real export, that's where the database or storage read would happen. Keep the stable client at module scope and the scoped instance inside the handler. If a formatter needs the decision, pass it the boolean or the scoped instance.

In production, resolve the workspace and its access rights from the authenticated session before reading the report. The two selectable paths here are fixtures for public sample data. A caller's choice of a header, query string, or workspace slug can't establish permission to read another customer's report. The endpoint also prevents shared response caching. If you cache real exports, the cache needs to distinguish the workspace and the report format, along with any other inputs that change the response.

Test two requests that overlap

In the first terminal, type-check the service and start it. A successful type check exits quietly. The next command prints the loopback address and keeps the server running.

npx tsc --noEmit
npx tsx server.ts

Save the following as verify.mjs. In a second terminal, run node verify.mjs. Node's built-in fetch calls the local server. Strict assertions compare the full header and data row, including where each row ends.

import assert from "node:assert/strict";

async function report(name) {
  const response = await fetch("http://127.0.0.1:4178/demo/" + name);
  assert.equal(response.status, 200);
  return response.text();
}

const [preview, standard, previewAgain] = await Promise.all([
  report("preview"), report("standard"), report("preview"),
]);

assert.equal(preview, "period,downloads,unique_readers\nweek-1,80,55\n");
assert.equal(standard, "period,downloads\nweek-1,80\n");
assert.equal(previewAgain, preview);
console.log("Both workspaces received the expected CSV.");

You should see the single success line. Testing just the preview workspace proves that the code can add a column. Testing both responses catches the more expensive mistake of silently changing an existing customer's export. Keeping the old format assertion around is especially valuable when the downstream importer belongs to someone outside your team.

To check the compile-time boundary, temporarily change gb.isOn("includeUniqueReaders") to gb.isOn("includeUniqueReader") and rerun npx tsc --noEmit. The diagnostic should identify the misspelled key. Restore it before running the server again. A coding agent can include the before-and-after type check and the two CSV headers in its pull request.

Decide when to expand the report

When one preview customer is ready, leave everyone else on the default. If the next step is to enroll a fraction of workspaces, choose an attribute that matches the promise you're making. Hashing a workspace ID lets colleagues downloading the same report share a format. Hashing each user's ID could give two analysts in the same company different column sets. The one-shot guide shows how to express a percentage and hash attribute in a local rule.

A new rule in flags.ts reaches a process through your deployment. During a rolling deploy, the same workspace might hit old and new processes. If customers need a durable choice of export schema, keep supporting the agreed format in the API itself. When the operational requirement is to change targeting between deploys, you can keep the scoped evaluation in the handler and change how the process receives its rules. The free GrowthBook offerings overview covers Cloud Starter and self-hosting for teams that want to manage those rules.

Manage report targeting in Cloud

Create a GrowthBook workspace when the team supporting exports needs to expand the preview independently of a server release.

Get Started with GrowthBook
Feature Flags
Experiments

Use local feature flags in the Next.js App Router

Nov 20, 2026
x
min read

Your conference agenda has a new “Show room” button. Reviewers should see it on the first page load. Everyone else should get the existing agenda. If a Server Component renders the old agenda and a browser hook independently decides to show the new button, the first HTML and the browser can disagree.

In the Next.js App Router, the server can make this decision once and pass a boolean to the interactive component. We'll define the flag in the repo, select the preview audience with a local test cookie, and verify the actual HTML for both visitors. Clicking the button will still work after hydration. You can follow along without a GrowthBook account or client key. If you're assigning this work to an agent, the free feature flags for coding agents walkthrough gives the background.

Keep the flag definitions on the server

Use a TypeScript App Router project, or create a small one with create-next-app. These paths assume the project has an app directory at its root. If yours uses src/app, put both app and lib under src so the relative imports still match.

npx create-next-app@latest agenda-flags --ts --app --empty --use-npm --no-src-dir --no-tailwind --yes
cd agenda-flags
npm install @growthbook/growthbook@^2.2.0 server-only

Keep the starter's root layout. Create lib/agenda-flags.ts with the following code. The SDK type registration update explains how LocalFeatures checks the flag and its rule against the registered types. This setup requires version 2.2.0 or later.

import "server-only";
import { GrowthBookClient, type LocalFeatures } from "@growthbook/growthbook";

type Features = { agendaRoomDetails: boolean };
type Attributes = { audience: "preview" | "public" };

declare module "@growthbook/growthbook" {
  interface Register {
    features: Features;
    attributes: Attributes;
  }
}

const features: LocalFeatures = {
  agendaRoomDetails: {
    defaultValue: false,
    rules: [{ condition: { audience: "preview" }, force: true }],
  },
};

const client = new GrowthBookClient({ defaultHashVersion: 2 })
  .initSync({ payload: { features } });

export function showRoomDetails(audience: Attributes["audience"]) {
  const gb = client.createScopedInstance({ attributes: { audience } });
  return gb.isOn("agendaRoomDetails");
}

The module can reuse the client and rules across requests handled by the same process. It only holds the current visitor's audience inside the function call. Two requests can therefore use the same flag file and get different results. The Node.js SDK documents the scoped client used under the App Router here.

This particular rule has no percentage and needs no visitor ID. The two audiences are sufficient. If the team later asks for a rollout to 10% of attendees, add a stable attendee or registration ID and choose which of those units should stay together. Jeremy Dorn's Register pattern article explains how a change to an attribute type reaches the call sites that construct it.

Read the cookie for this request

Create app/agenda/page.tsx. The static heading can render for everyone. The request-specific content sits behind a Suspense boundary, so the fallback can show a neutral loading message until the server has the cookie.

import { Suspense } from "react";
import { cookies } from "next/headers";
import { showRoomDetails } from "../../lib/agenda-flags";
import { Agenda } from "./Agenda";

async function AgendaForVisitor() {
  const jar = await cookies();
  const audience = jar.get("agenda-preview")?.value === "1"
    ? "preview"
    : "public";

  return <Agenda showRoom={showRoomDetails(audience)} />;
}

export default function AgendaPage() {
  return (
    <main>
      <h1>Conference agenda</h1>
      <Suspense fallback={<p>Loading the agenda…</p>}>
        <AgendaForVisitor />
      </Suspense>
    </main>
  );
}

The App Router's cookies function reads the incoming request asynchronously. Read it inside the visitor-specific component. Keeping that read out of shared cached code lets the surrounding page reuse common content without treating one visitor's decision as another's. This placement also accommodates App Router projects using Cache Components.

Give your agent the Next.js setup

Use the local flags guide with a concrete request to evaluate one flag on the server and return the same decision to the browser.

Open the Local Flags Guide

The cookie in this demo is a convenient way to preview a public UI treatment. Anyone with that cookie can see the room label. To target paying attendees or private sessions, obtain the audience from the verified session on the server and authorize the underlying data separately.

Pass one decision to the interactive component

Create app/agenda/Agenda.tsx. It's a Client Component because a visitor can open and close the room details. Its initial branch comes directly from the boolean supplied by the page.

"use client";

import { useState } from "react";

export function Agenda({ showRoom }: { showRoom: boolean }) {
  const [open, setOpen] = useState(false);

  return (
    <section data-agenda={showRoom ? "preview" : "standard"}>
      <h2>10:00 · Designing for print</h2>
      {showRoom && (
        <>
          <button aria-expanded={open} onClick={() => setOpen(!open)}>
            {open ? "Hide room" : "Show room"}
          </button>
          {open && <p>Room 204</p>}
        </>
      )}
    </section>
  );
}

The client boundary takes a serializable prop. The component receives true or false. The SDK instance, targeting rules, and cookie handling stay in the server module. You don't need a React provider for this component because its only browser-side choice is whether the visitor has clicked the button.

Follow one page load through server rendering and hydration. For a preview visitor, the server can send a section with a “Show room” button. React's first client render gets the same showRoom value and starts with open set to false. Hydration attaches the click handler. Opening the room detail then updates component state and doesn't require another flag evaluation.

Verify the HTML and the click separately

Build the production app and start it on port 3100.

npm run build
npm run start -- -p 3100

In a second terminal, save this as verify-agenda.mjs in the project root and run node verify-agenda.mjs. The test makes two requests to the same route and looks for a marker on the rendered section. A marker in the HTML helps catch an implementation that only adds the intended layout after JavaScript runs.

import assert from "node:assert/strict";

async function agenda(cookie) {
  const response = await fetch("http://localhost:3100/agenda", {
    headers: cookie ? { Cookie: cookie } : {},
  });
  assert.equal(response.status, 200);
  return response.text();
}

const [standard, preview] = await Promise.all([
  agenda(""), agenda("agenda-preview=1"),
]);
assert.match(standard, /<section data-agenda="standard"/);
assert.doesNotMatch(standard, /<section data-agenda="preview"/);
assert.match(preview, /<section data-agenda="preview"/);
assert.doesNotMatch(preview, /<section data-agenda="standard"/);
console.log("Both agenda layouts arrived in the server HTML.");

Now open http://localhost:3100/agenda in a fresh browser profile. You should see the session title without a room button. In that local page's browser console, set the demo cookie and reload.

document.cookie = "agenda-preview=1; Path=/; SameSite=Lax";
location.reload();

Click Show room and look for Room 204. Click Hide room and the room should disappear. This second check proves the component became interactive. If the server response test passes but the click fails, inspect the browser console for a hydration error before changing the flag rules.

Remove the fixture and reload once more. The button should disappear and the agenda title should remain.

document.cookie = "agenda-preview=; Path=/; Max-Age=0";
location.reload();

The reload is deliberate. Editing the cookie in an already open document doesn't rerun its Server Component. In your app, use the normal session-change flow to request a fresh server render when a visitor signs in, signs out, or leaves a preview group.

Choose where the next flag should be evaluated

For a decision needed in the initial HTML, give the agent an observable requirement. Ask it to show the two HTTP responses, then click the interactive control in the preview. The first check catches an incorrect layout. The second catches correct HTML that never becomes interactive.

If a later feature depends on an action entirely within the browser, evaluate whether its flag belongs in the client tree. The one-shot local flags guide covers both placements. This agenda only needs one server decision. Updating its checked-in rule takes a deployment. Keep that tradeoff in view if the event organizer needs to pause a preview while attendees are already arriving. For that case, compare GrowthBook’s free options for changing flags between deploys.

Manage the agenda rollout in Cloud

Create a GrowthBook workspace when the organizer needs to adjust a preview audience while your Next.js app is serving attendees.

Get Started with GrowthBook

Ready to ship faster?

No credit card required. Start with feature flags, experimentation, and product analytics—free.

Simplified white illustration of a right angle ruler or carpenter's square tool.White checkmark symbol with a scattered pixelated effect around its edges on a transparent background.