Best 6 open-source alternatives to Statsig

An open-source Statsig alternative has to replace more than a feature-gate API. Statsig combines assignment, experimentation, product analytics, and session replay, so a credible replacement must either cover that surface or state clearly which parts your team will assemble elsewhere.
Open source changes the operating model. It can let engineers inspect evaluation and statistical logic, deploy the control plane inside their network, keep configuration and metrics under internal governance, and preserve a practical exit path. It can also transfer upgrades, scaling, backups, security, and on-call ownership to the buyer.
The current company context adds another reason to evaluate portability. OpenAI acquired Statsig in 2025, and Amplitude said it would develop the Statsig platform across cloud and warehouse deployments while supporting existing customers. Statsig remains available, but buyers now have to evaluate both today's product and the convergence roadmap.
This guide compares GrowthBook, PostHog, Unleash, Flagsmith, FeatBit, and Flipt. GrowthBook is the strongest full-platform alternative. PostHog covers a similarly broad product surface in the cloud but has an officially unsupported self-hosting path. The other four are feature-management systems; they can replace Statsig gates and dynamic configuration, not the complete analytics and experimentation suite by themselves.
Open-source Statsig alternatives at a glance
| Alternative | License shape | Replaces well | Missing or limited compared with Statsig |
|---|---|---|---|
| GrowthBook | MIT-licensed core; separate enterprise directories | Flags, rigorous experiments, warehouse metrics, product analytics | Session replay is not the product focus |
| PostHog | MIT-licensed core; separate enterprise directory | Flags, experiments, analytics, replay, error context | Self-hosting is officially unsupported; cloud has many meters |
| Unleash | AGPL-3.0 control plane | Feature flags, variants, rollout governance, self-hosting | Full experiment statistics and product analytics need another layer |
| Flagsmith | Primarily BSD-3-Clause core | Flags, remote config, identities, flexible hosting | Experiment analysis and product analytics need another layer |
| FeatBit | MIT-licensed core with licensed advanced features | Self-hosted flags, workflows, simple experimentation | Experimentation is beta and analytics are narrower |
| Flipt | GPL-3.0 server | Git-native flags, APIs, OpenFeature-oriented infrastructure | No integrated product analytics or mature experiment program |
The table exposes the central choice. If the requirement is “Statsig, but open source,” start with GrowthBook. If the requirement is “move feature gates out of Statsig,” the other systems deserve a proof of concept. If replay and event analytics are dominant, PostHog Cloud can be a closer functional match even though its supported operating model is not a conventional self-hosted product.
What “open-source alternative” should mean
Use GrowthBook pricing to compare the hosted path with the infrastructure and operating costs of self-hosting.
Verify the deployable system, not the homepage label
The Open Source Definition is a useful baseline, but a production platform can contain components with different licenses. Inspect the server, UI, proxy, SDKs, enterprise directories, container images, and deployment charts required for the architecture you intend to run.
Open core is common. A permissively licensed or copyleft core may include ordinary flags and experiments, while SSO, advanced RBAC, approvals, audit export, support, or high-availability tooling requires a commercial license. That is not inherently a problem. The mistake is comparing the free core with every capability in a vendor's enterprise edition.
Record the exact commit or release and license files reviewed. Licenses can change, as Unleash's move from older Apache descriptions to AGPL-3.0 demonstrates. Ask counsel to review obligations for modified network services, redistribution, embedded SDKs, and proprietary extensions.
Separate source availability from supported self-hosting
A public repository does not guarantee production support. PostHog illustrates the distinction: its core is open, and a Docker Compose path exists, but its self-hosting documentation says the deployment is officially unsupported, has no paid support or guarantees, follows continuous master rather than tagged self-host releases, and keeps paid-plan features cloud-only.
Conversely, a focused project may have a smaller product surface and a clearer self-hosted commitment. Flipt shut down its hosted cloud service and doubled down on self-hosting. FeatBit, Flagsmith, Unleash, and GrowthBook publish explicit self-managed paths and commercial support options.
Map the whole Statsig workload
Inventory which Statsig products are actually in use:
- Feature gates and dynamic configurations.
- Experiments, layers, holdouts, and exposure events.
- Metric definitions and statistical analysis.
- Product analytics, funnels, cohorts, and retention.
- Session replay and diagnostic context.
- Warehouse connections and event pipelines.
- Approvals, roles, SSO, audit history, and support.
A team using only gates should not deploy an analytics cluster it does not need. A team using Statsig as its product data system should not replace it with a flag server and assume the missing evidence will appear later. Decide whether the desired outcome is a single open-source platform or a composable stack with explicit owners.
Treat operations as part of product fit
Self-hosting adds a service to the production estate. The control plane stores policy that changes application behavior. The metric system may process sensitive product data. The analytics layer can introduce a columnar database, stream processor, object store, cache, queue, and several workers.
Require documented recovery point and recovery time objectives, upgrade cadence, vulnerability response, backups, regional topology, observability, and on-call escalation. A repository that starts with one Docker command may still become a substantial distributed system at production volume.
How to audit an open-source finalist
Open source makes more evidence available, but someone still has to inspect it. Use the same audit for every finalist so popularity and vendor messaging do not substitute for operational proof.
License every required component
Create a bill of materials for the exact deployment. Include the control-plane server, web UI, SDKs, proxy or relay, Helm chart, Terraform modules, database extensions, analytics workers, and container images. Record the SPDX identifier and the path to the authoritative license text for each component.
Do not infer the server license from an SDK package or GitHub badge. Flipt's server is GPL-3.0 while its SDKs can use different terms. GrowthBook and PostHog have permissive cores with separately licensed enterprise directories. FeatBit identifies a mostly MIT core while restricting some advanced features. Flagsmith describes most of its platform as BSD-3-Clause with commercial enterprise capabilities. Those are four distinct obligations and procurement models.
Use the SPDX license list to normalize identifiers, then have counsel review how the software will be modified, deployed, and exposed. The practical questions include whether the organization distributes a binary, offers a modified network service, links proprietary code, or only calls an independent API. Keep the review with the deployment manifest so upgrades cannot silently introduce a new license boundary.
Review project health beyond star counts
Repository stars measure attention, not maintainability. Inspect tagged releases, time between security fixes, contributor concentration, issue response, supported upgrade paths, backward-compatibility policy, and whether the maintainers test database migrations and restores.
Look for a security policy with a private reporting channel. Review dependency-update automation, branch protection, CI coverage, artifact signing, and provenance. The OpenSSF Scorecard provides automated checks for several software-supply-chain practices, but a score is an input—not an approval. A project can score well while lacking the product support or statistical quality your organization needs.
Run dependency and image scans in the buyer's own pipeline. Pin images by digest for controlled rollouts, mirror critical artifacts when appropriate, and rehearse the response to an upstream compromise. The SLSA framework is a useful model for reasoning about build provenance and artifact integrity. Ask whether official releases are reproducible enough for your risk tier and how a maintainer communicates a compromised credential or release.
Inspect default telemetry and data paths
Self-hosting a dashboard does not prove that data stays inside the network. Start the platform in an isolated environment and observe outbound DNS, HTTP, package, telemetry, crash-report, license-check, and update traffic. Review every destination and decide which is allowed in production.
Trace the path for a feature context and an experiment event. Determine which attributes reach the SDK endpoint, proxy, logs, database, analytics worker, warehouse, support bundle, and backup. Apply retention and deletion policies to each copy. Client-side SDK payloads should not contain sensitive targeting logic, secrets, or server-only customer lists.
Make telemetry settings explicit in infrastructure-as-code. A default that can change between releases should not define the organization's privacy boundary. Test upgrades in an environment that blocks undeclared egress so a new dependency fails visibly rather than quietly opening a route.
Reproduce critical behavior from source
An inspectable repository is valuable only if the deployed artifact corresponds to the reviewed source. Record the version and image digest. Where the risk justifies it, build the server or SDK from source and compare behavior with the distributed artifact.
For flags, construct deterministic fixtures covering every operator, null and missing values, Unicode, semantic versions, dates, percentage bucketing, prerequisites, and typed values. Run the same fixture after every SDK or control-plane upgrade. A small semantic change can move users between treatments or alter a permission-like configuration without producing a compile error.
For experiments, reproduce at least one result outside the UI. Compare sample counts, exclusions, exposure windows, metric SQL, point estimates, uncertainty intervals, and quality warnings. The NIST engineering statistics handbook provides a vendor-neutral reference for statistical concepts, but the organization still needs a written decision policy for sequential looks, multiple metrics, outliers, and missing data.
Test recovery before production
A database backup is not a recovery plan until it has been restored. Create a clean environment, restore the latest backup, rotate secrets, reconnect an SDK, and verify the exact configuration version and audit history recovered. Measure the time and data loss.
Then simulate partial failure. Stop the UI, database, cache, stream component, proxy, and analytics worker one at a time. Observe whether applications continue evaluating from last-known configuration, whether new processes can start, whether operators can perform a kill switch, and whether exposures queue or disappear.
Document which component owns each recovery action. If the internal platform team cannot restore the system without a maintainer joining a call, commercial support may be part of the real production requirement even when the code is free.
1. GrowthBook: Best overall open-source Statsig alternative
Best for
GrowthBook is best for engineering, product, and data teams that want open-source feature flags, rigorous A/B testing, warehouse-native metrics, product analytics, and a supported choice between cloud and self-hosted deployment.
Key strengths
The GrowthBook repository describes an open-core platform whose bulk is under the MIT license, with named enterprise directories under a separate commercial license. It includes feature flags, remote configuration, local SDK evaluation, targeting, gradual rollouts, experimentation, SQL-backed metrics, and product analytics.
The platform is closest to Statsig's combined workflow without requiring a proprietary event store. Warehouse-native experimentation queries metrics from the organization's existing sources, so experiment definitions can reuse governed revenue, activation, retention, latency, and quality data. Analysts can inspect the generated SQL and reconcile results with the source of truth.
The statistics engine supports Bayesian and frequentist analysis, sequential testing, CUPED, post-stratification, sample ratio mismatch checks, guardrails, holdouts, and bandits as the plan supports. A flag rule can become an experiment, preserving the connection between delivery and evidence without turning every rollout into a causal claim.
GrowthBook feature flags evaluate locally after SDKs load configuration. The control plane can run in GrowthBook Cloud or inside the buyer's infrastructure. Built-in importers can reduce manual work when moving Statsig gates, though assignment and rule parity still require validation.
Watchouts
Warehouse-native analysis assumes trustworthy data and metric ownership. Teams without an event pipeline or warehouse may prefer a managed event product. Self-hosters own database availability, upgrades, backups, cache or proxy layers, secrets, monitoring, and support. Advanced approvals, roles, environments, and enterprise service levels require commercial packaging.
GrowthBook is not primarily a session-replay platform. If replay is a core Statsig use case, keep a separate diagnostic product or evaluate whether PostHog's broader suite is more important than full self-hosting support.
Pricing and implementation notes
The open-source self-hosted plan is free with unlimited flags, experiments, and traffic. The current cloud Starter plan is also free for three users and one project; Pro is $40 per seat per month. CDN requests, bandwidth, advanced statistics, and governance vary by plan, so compare the complete architecture.
For a proof of concept, connect one production-like data source, define a governed metric, import a representative gate, run a server and client SDK, and reconcile a completed experiment with an independent SQL query. Start with a small GrowthBook deployment before migrating the full Statsig estate.
2. PostHog: Broadest open-source product suite
Best for
PostHog is best for product engineering teams that want flags, experiments, product analytics, session replay, error tracking, surveys, and data tools in one cloud suite and value source availability more than a supported self-hosted operating model.
Key strengths
The PostHog repository contains a large product platform whose code outside the ee directory uses the MIT Expat license. Feature flags support person and group targeting, cohorts, percentage rollouts, payloads, dependencies, remote configuration, phased releases, and server-side local evaluation. Experiments use the same identities and event data as product analytics.
That product breadth is the closest in this list to Statsig's event-centric bundle. A team can review the session replay and exceptions for exposed users, explore funnels and cohorts, and connect the same properties to flags. For a small engineering-led company, consolidation can be more valuable than a best-of-breed statistics engine.
Cloud pricing is transparent and usage based. Current free allowances include one million analytics events, one million feature-flag requests, 5,000 replay recordings, one project, one-year retention, and unlimited members. Experiments are billed through feature-flag requests.
Watchouts
Do not describe PostHog as a supported self-hosted Statsig replacement. The current hobby deployment carries no product or infrastructure support, no guarantees, no supported version lifecycle, and no paid-plan features. The official documentation recommends Cloud for most users and warns that serious volume needs substantial infrastructure expertise.
The cloud suite has separate meters for analytics events, flag requests, replay, exceptions, pipelines, warehouse rows, AI features, and other products. Advanced experiment teams should validate statistical methods, metric governance, assignment behavior, and quality checks rather than assuming an integrated report matches their decision standard.
Pricing and implementation notes
PostHog Cloud keeps each product's free allowance after billing begins, then charges by volume. Feature flags start at $0.0001 per request for the first paid tier and decline with scale. Estimate the whole suite, including replay and analytics, and set billing limits deliberately.
In the proof of concept, test identity merges, group-level assignment, local evaluation, experiment exposure timing, event schemas, replay access controls, and the cost of a high-traffic launch. If self-hosting is mandatory, eliminate PostHog early unless the organization formally accepts the unsupported model.
Compare open-source paths
See how GrowthBook and Statsig differ on deployment control, warehouse metrics, feature flags, experimentation, and predictable scale.
Compare GrowthBook and Statsig3. Unleash: Best open-source feature-management specialist
Best for
Unleash fits platform teams that want a mature self-hosted feature-management control plane and plan to keep experimentation statistics and product analytics in other systems.
Key strengths
The Unleash control plane supports activation strategies, constraints, variants, segments, projects, environments, tags, lifecycle tracking, APIs, and more than two dozen SDKs. SDKs synchronize configuration and evaluate locally, which keeps ordinary application decisions independent of a synchronous control-plane call.
Custom strategies are useful when an organization has a targeting rule that cannot be expressed cleanly through ordinary attributes. An OpenFeature provider can reduce source-code coupling. Paid editions add cloud hosting, supported self-hosting, approvals, roles, audit history, safeguards, service commitments, and collaboration workflows.
The license is now AGPL-3.0. That remains an open-source license, but its network-service obligations differ materially from permissive MIT or BSD licenses. Legal review should cover any server modifications and the way the organization makes the service available.
Watchouts
Unleash variants and impact metrics do not reproduce the full Statsig experimentation and analytics workflow. You need a durable exposure event, metric definitions, sample ratio checks, statistical analysis, and decision policy elsewhere. The open-source and enterprise feature boundary also affects approvals, governance, support, and audit needs.
Pricing and implementation notes
The community project has no subscription fee. Current enterprise pay-as-you-go pricing is $75 per seat per month; its self-hosted offer has a five-seat minimum, while cloud includes a published API allowance. Custom enterprise plans cover larger cloud, self-hosted, or hybrid deployments.
Test an upgrade, database restore, multi-service propagation, custom strategy, and analytics handoff. If the team cannot name the system that will analyze exposures, Unleash is not yet a complete migration plan.
4. Flagsmith: Best for flags and remote configuration
Best for
Flagsmith is best for teams that want an open-source flag and remote-configuration service with cloud, private-cloud, self-hosted, and air-gapped deployment options.
Key strengths
The Flagsmith repository contains the API, dashboard, and core platform under a BSD-3-Clause license for most components. The product supports boolean flags, configuration values, identities, traits, reusable segments, multivariate options, environments, webhooks, APIs, and client and server SDKs.
Remote configuration makes it useful for limits, endpoints, UI text, model selection, and other typed behavior that Statsig users may currently store in dynamic configs. Flexible hosting helps organizations with regional, network, or private-infrastructure requirements.
The open-source edition provides ordinary flagging, while commercial plans add deeper governance, support, change requests, SSO, roles, permissions, audit history, and tailored deployment. This split can be attractive when the buyer wants a permissively licensed core and is comfortable purchasing operational controls.
Watchouts
Flagsmith supports A/B and multivariate workflows, but it is not a replacement for Statsig's advanced experiment statistics or product analytics. Plan a separate measurement layer. Review the exact code and license for every commercial capability needed; “the platform is BSD” does not mean the enterprise distribution is entirely covered by that license.
Pricing and implementation notes
Self-hosted open source has no core subscription fee. The hosted Free plan currently includes 50,000 requests per month and one member. Start-Up is $45 per month for one million requests and three members, while Scale-Up is $300 per month and adds governance for larger teams.
Test typed values, identity traits, client-safe payloads, offline behavior, import/export, and database recovery. Cost the cache and database as well as the support hours required to operate them.
5. FeatBit: Best packaged self-hosted control plane
Best for
FeatBit is worth evaluating for engineering teams that want a familiar self-hosted flag dashboard, progressive delivery, workflows, and a simpler experiment capability under an open-core model.
Key strengths
The FeatBit repository places most code under the MIT license and provides Docker Compose, Kubernetes, SDKs, OpenFeature providers, targeting, segments, insights, audit logs, workflows, APIs, SSO, relay components, and data export. It is closer to a packaged commercial feature-management experience than a minimal flag daemon.
FeatBit documentation includes feature-level A/B testing, primary and guardrail metrics, Bayesian analysis, bandit arms, and rollout insights. The current pricing page labels experimentation as beta and CUPED as “soon,” which is an important boundary for Statsig teams accustomed to mature statistical tooling.
Self-hosting is an explicit product path, not a hobby disclaimer. The Foundation edition is free, and enterprise packaging adds security, workflow, high-availability advice, support, and service levels without usage limits on self-host plans.
Watchouts
FeatBit is not a broad product analytics or replay replacement. Its experiment maturity, contributor concentration, release process, security response, documentation, and upgrade experience need direct evaluation. Some advanced capabilities require a valid license even though the repository is mostly MIT licensed.
Pricing and implementation notes
The current self-hosted Foundation plan is free. Enterprise is published at $3,999 per year, with advanced RBAC as an additional $600 per year; premium packages are custom. Cloud plans use monthly active users and separate terms.
Run an upgrade, backup restore, relay failure, WebSocket reconnect, and SDK matrix. For experimentation, reconcile a completed result with an independent calculation and confirm exactly which methods are production-ready rather than planned.
6. Flipt: Best for Git-native feature flags
Best for
Flipt fits infrastructure and platform teams that want Git-native configuration, self-hosted feature management, APIs, and a narrow system that can slot into a composable experimentation stack.
Key strengths
The Flipt repository provides a GPL-3.0 server with boolean and variant flags, rules, rollouts, namespaces, REST and gRPC APIs, real-time updates, and OpenFeature integrations. Flipt v2 emphasizes Git as the durable source of configuration, with the UI able to participate in reviewed change workflows.
Git-native authoring can align feature policy with existing pull requests, code review, environment promotion, and rollback. The configuration history remains outside a proprietary dashboard, and a focused runtime has less product surface to operate than an analytics suite.
Flipt discontinued its hosted Cloud service in 2025 and now emphasizes self-hosting. The current open-source edition is free with unlimited flags, while Flipt Pro adds Git provider integration, UI-created pull requests, and commercial capabilities at a published flat price.
Watchouts
Flipt is not a direct replacement for Statsig experiments, product analytics, or replay. A Git pull request may also be too slow for an emergency kill switch unless the team designs a privileged, audited path. GPL-3.0 obligations differ from permissive licenses, and SDK licenses may differ from the server.
Pricing and implementation notes
The open-source server is free. Flipt Pro is currently listed at $200 per month before annual discounting. Infrastructure, support, and any separate analytics or experiment platform remain additional costs.
Test Git reconciliation, conflicting edits, delayed webhooks, rapid rollback, configuration propagation, repository outage, and a break-glass production change. Treat the Git provider as part of the runtime control architecture even if flag evaluation remains local.
How the six options map to the Statsig product surface
No open-source label makes missing capabilities disappear. Use a capability map before choosing a single product or composing a stack:
| Capability | GrowthBook | PostHog | Unleash | Flagsmith | FeatBit | Flipt |
|---|---|---|---|---|---|---|
| Feature flags and targeting | Strong | Strong | Strong | Strong | Strong | Strong |
| Typed remote configuration | Strong | Strong | Variants/config patterns | Strong | Strong | Variants |
| Rigorous experiment statistics | Strong | Moderate; verify fit | Separate layer | Separate layer | Emerging/beta | Separate layer |
| Product analytics | Built in, warehouse-native | Broad event analytics | Separate layer | Separate layer | Limited insights | Separate layer |
| Session replay | Separate product | Built in | Separate product | Separate product | Separate product | Separate product |
| Supported self-hosting path | Yes | No | Yes | Yes | Yes | Yes |
| Managed cloud option | Yes | Yes | Yes | Yes | Yes | No hosted cloud |
The most common stack patterns are:
- GrowthBook plus an existing warehouse: closest open-source replacement for Statsig flags and experimentation, with analytics grounded in governed source data.
- PostHog Cloud: closest event-centric suite when supported self-hosting is not required and replay matters.
- Unleash or Flagsmith plus GrowthBook experimentation: specialized flag operations with warehouse-native analysis, at the cost of integrating assignment and exposures carefully.
- FeatBit or Flipt plus an analytics platform: self-hosted delivery control for teams willing to build the experiment and product-data workflow separately.
Do not double-randomize. If one platform assigns a flag and another analyzes the experiment, the exposure event must contain the exact assigned variation, stable unit, timestamp, and experiment namespace. The analytics system should not independently split the same population again.
Build a realistic self-hosting cost model
Use four cost categories.
License and support
Record the free license, commercial feature license, support contract, and SLA. Include legal review for AGPL or GPL software and renewal risk for open-core enterprise features.
Infrastructure
Include compute, database, cache, object storage, queue or stream services, ingress, certificates, secrets, monitoring, logs, backups, and network transfer. Model multiple regions and disaster recovery if the current Statsig contract provides comparable resilience.
Platform engineering
Estimate installation, infrastructure-as-code, upgrades, vulnerability response, capacity work, restores, user support, SDK compatibility, and on-call incidents. Price engineering time even when no new headcount is required.
Missing-product work
Include the analytics, replay, experiment statistics, approvals, code references, and lifecycle automation that must be bought or built. A free flag server becomes expensive when a team reconstructs half of Statsig around it.
Run expected and stressed cases over three years. The stressed case should include doubled service count, one regional deployment, one urgent security update, one failed upgrade, and one restoration exercise. This does not predict failure; it shows whether the savings depend on every operational assumption going perfectly.
Convert the model into named capacity, not an anonymous percentage of engineering time. Identify the team that owns the service, the primary and secondary on-call responders, the database and security reviewers, and the budget for urgent maintenance. Estimate how many hours a normal upgrade, a failed migration, a certificate rotation, and a user-support question consume. If no team will accept that work, the self-hosted option is not actually available regardless of license. If the work fits an existing platform charter, self-hosting can produce durable control and predictable scale. Compare that internal service commitment with the support, uptime, and escalation terms of each managed edition on the same worksheet.
Migration plan from Statsig
Inventory before selecting a destination
Export feature gates, dynamic configurations, experiments, layers, holdouts, metrics, cohorts, projects, environments, owners, tags, dashboards, and replay dependencies. Scan repositories for SDK initialization, checks, config reads, fallbacks, overrides, event calls, and exposure hooks.
Classify each object by destination. A feature gate may move to Unleash while its experiment metric moves to GrowthBook and its replay remains in another product. Write that mapping before any SDK is replaced.
Preserve semantics and assignments
Build fixtures for context attributes, operator behavior, segments, prerequisites, typed values, nulls, and percentage rollouts. Different providers can assign different users at the same percentage. Finish active experiments or preserve assignments explicitly through an exported mapping or compatible bucket key.
Run both evaluators in shadow mode. Compare outcomes without letting the candidate control behavior. Investigate every meaningful mismatch and avoid logging sensitive rule data or personal attributes.
Migrate the evidence pipeline separately
Define the exposure contract: experiment ID, variation, timestamp, randomization unit, environment, and relevant context version. Reconcile event counts from SDK to warehouse. Rebuild metric definitions and validate historical queries before interpreting a new result.
Move dashboards and replay links only after the underlying identity model is stable. A migration that changes anonymous-to-known-user merging can distort funnels, retention, and experiment attribution even when feature flags behave correctly.
Cut over in risk order
Start with dormant and internal flags, then low-risk configuration and ordinary releases. Move operational kill switches, permissions, billing controls, and active experiments last. Keep a rollback path until evaluation parity, propagation, exposure completeness, and operator confidence meet written thresholds.
Proof-of-concept checklist
Give every finalist or stack the same workload:
- One client SDK, two server SDKs, and an OpenFeature adapter where relevant.
- Twenty-five active flags, including typed JSON, prerequisites, and account targeting.
- One user-level and one account-level experiment.
- A metric derived independently from the warehouse or event store.
- Three environments, two projects, and a production approval flow.
- Cold start without the control plane and network loss after initialization.
- A configuration rollback and credential rotation.
- Database backup and restore for self-hosted systems.
- An upgrade across one supported release boundary.
- A complete monthly and three-year cost calculation.
Require the future operator to conduct the test. A vendor or project maintainer can help, but the internal team needs to prove it can diagnose a stale configuration, mismatched assignment, missing exposure, failed migration, and broken dashboard.
Final recommendation
Choose GrowthBook when you want the strongest open-source replacement for Statsig's feature flags and experimentation, backed by warehouse-native metrics and a supported self-hosted path. Choose PostHog Cloud when broad product analytics and replay matter more than supported self-hosting. Choose Unleash for mature flag specialization, Flagsmith for remote configuration and hosting flexibility, FeatBit for a packaged self-hosted control plane with emerging experiments, and Flipt for Git-native feature management.
For most technical product teams, GrowthBook is the first proof of concept because it replaces the highest-value Statsig loop: control a release, record a stable exposure, analyze governed metrics, and make a defensible decision. Its open-source foundation also keeps deployment and inspection choices available as the organization grows.
Start with GrowthBook for free and migrate one representative gate plus its metric. For a larger multi-product estate, book a GrowthBook demo and bring the license, deployment, data, and governance requirements.
Own the experiment loop
Test open-source flags and warehouse-native analysis together before replacing Statsig across your product stack.
Start an open-source proof of conceptRelated Articles
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.
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.
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.
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 GuideThe 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.
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.
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.
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.
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 GrowthBookTwo 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.
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.
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.
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 GuideCreate 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.
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.
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.
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 GrowthBookYour 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.
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.
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.
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 GuideThe 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.
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.
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.
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.
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.
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 GrowthBookReady to ship faster?
No credit card required. Start with feature flags, experimentation, and product analytics—free.




