dif vs Statsig
Checked Oct 7, 2026
Statsig is a hosted console with a stats engine behind it. You create a feature gate, a dynamic config or an experiment in the console, server SDKs poll for the new rule sets every 10 seconds by default, and results come back with confidence intervals, CUPED variance reduction and a choice of frequentist, sequential or Bayesian analysis. dif is a file format and a compiler: each flag is a Markdown file in your repo, dif build compiles it into a TypeScript client, and a change reaches users with your next deploy. Statsig is the better tool when a gate must change without a deploy, when your services are not JavaScript, when a flag has to carry a JSON value, or when you want the statistics computed for you at no cost up to 2M events a month. dif fits a TypeScript codebase where a flag change should be a reviewed pull request, evaluating a flag should need no network, and the hypothesis and decision should sit in the same file as the flag.
Side by side
| Row | dif | Statsig |
|---|---|---|
| Where flags live | One Markdown file per flag or experiment under dif/experiments/, in your git repo. | In a Statsig project. You create feature gates, dynamic configs and experiments in the Statsig console, or through its MCP server. [2][13] |
| How a change ships | Edit the file, merge the pull request, run dif build, deploy the app. There is no runtime toggle. | Change the gate in the console. Server SDKs poll Statsig for updated rule sets every 10 seconds by default. Client SDKs keep their values until the next initialize or updateUser call. [2][3][5] |
| Runtime dependency | None. dif build compiles the active files into dif/generated/client.ts and @dif.sh/sdk hashes the user ID with SHA-256 in-process. No request to evaluate a flag. | A connection to Statsig. Server SDKs fetch the rule sets at startup, evaluate in-process and keep polling. Client SDKs request precomputed values for the user at initialize, store them in local storage and fall back to that cache if the request fails. [3][4][5] |
| SDK languages | JavaScript and TypeScript only. Adapters for React, Svelte, the Vercel Flags SDK and an OpenFeature server provider. | Server SDKs: Node.js, Java, Python, Go, Ruby, .NET, PHP, Rust and C++. Client SDKs: JavaScript, React, React Native, Next.js, Angular, Swift, Android, .NET, Roku, Unity, Dart/Flutter and C++. [6] |
| Experiment analysis | Not in the open-source core. Exposures and dif.track() calls go to two handler functions you own, or to Dif Cloud, which reports lift with a 95% confidence interval. | Built in. The Stats Engine supports frequentist, SPRT and Bayesian analysis, applies CUPED automatically, and offers sequential testing that adjusts p-values and confidence intervals for early reads. [7] |
| Pricing model | The CLI and SDK are free. Dif Cloud is optional: $50 per month per workspace with 1,000,000 events and unlimited seats, then $0.02 per 1,000 events. Cloud has no free tier. | Event-based. Developer is free with 2M events per month. Pro is $150 per month with 5M events, then $0.05 per 1K events. Enterprise is a custom quote. Flag and config checks are listed as unlimited on Developer and Pro. [1] |
| Licence | MIT for the CLI, the SDK and every adapter. | A hosted commercial service. The SDK repositories read for this page (statsig-io/statsig-server-core and statsig-io/js-client-monorepo) are ISC licensed. [1][15][16] |
| Self-hosting | Nothing to host. There is no flag server; the flags run from your repo and your build. Dif Cloud is a hosted product. | Hosted by Statsig. The Enterprise plan lists a Warehouse Native deployment, where experiment analysis runs in your own data warehouse and the queries, intermediate datasets and results stay there. [1][12] |
| Agent and context support | dif init writes guidance into CLAUDE.md, AGENTS.md, .cursor/rules/dif.mdc and .github/copilot-instructions.md and installs four skills. dif build writes dif/context.json, a summary of active experiments. Dif Cloud serves experiment verdicts to agents over a read-only MCP server at cloud.dif.sh/mcp. | An MCP server with 18 default tools. An agent can read gates, experiments, dynamic configs, metrics and audit logs, and create or update gates, experiments and dynamic configs with a write key. Setup guides cover Codex, Cursor and Claude Code. The docs publish llms.txt. [13][14] |
| Flag values | String variant ids only. No typed values, no JSON payloads, no remote config. | Dynamic configs return JSON defined on the server, up to 100kb, and can change without a redeploy. [8] |
| Targeting rules | Equality and list membership on attributes declared in dif/config.yaml. No ranges, regex, semver or nested groups. | Conditions include user ID, email, country, IP address, app and browser version with >= and <, custom fields with number, version and date comparisons, regex on device model and unit ID, time windows, segments and other gates. [9] |
| Environments | None. The schema has no environment field. | A rule can target an environment tier: development, staging, production or another you name. [9] |
| Scheduled rollout and rollback | None. Changing a weight is an edit, a merge, a dif build and a deploy. metrics.guardrails is a list of names the core does not watch. | A gate can be set up as a Scheduled Rollout. A Safeguard watches alerts on a targeting rule and can roll the rule back to 0%, roll it out to 100% or pause the schedule. [2][10] |
| Holdouts | No holdout object. You resolve a boolean attribute yourself and add it to audience.exclude in each file. | Built in. A holdout withholds a small share of users, typically 1% to 2%, from a set of features so their combined effect can be measured. [11] |
| Who maintains it | An MIT repository at github.com/dif-sh/dif. Your flag files stay in your own repo. | On 2026-05-05 Amplitude announced a partnership with Statsig. Its post says Amplitude will take on the Statsig brand and customers and will maintain and develop the current Statsig platform, and it refers to the Statsig team at OpenAI. [17] |
The dif column is checked against the dif repository at v0.7.0. The Statsig column comes from the pages listed under Sources. If a row is out of date, open an issue.
Which one to choose
Choose Statsig if
- A gate has to change without a deploy. Statsig server SDKs pick up a console change on their next poll, 10 seconds by default. In dif, turning a flag off is a merge, a dif build and a deploy.
- You want the statistics computed for you. Statsig reports confidence intervals with CUPED, sequential testing and a Bayesian option. The dif open-source core computes no lift, confidence or sample size.
- Your services are written in Java, Python, Go, Ruby, .NET, PHP, Rust or C++, or you ship Swift, Android, Unity or Roku apps. dif has a JavaScript and TypeScript SDK and nothing else.
- A flag has to carry a value. Dynamic configs return JSON. dif variants are string ids.
- You target on version comparisons, dates, regex or numeric ranges, or you need different rules per environment tier. dif audiences match by equality or list membership and have no environment field.
- You want a metric regression to roll a gate back automatically. Statsig Safeguards do that. dif does not watch guardrail metrics.
- You want hosted results at no cost while you are small. Statsig Developer includes 2M events a month. Dif Cloud has no free tier.
Choose dif if
- Your app is TypeScript and a flag change can wait for the next deploy.
- You want every flag change reviewed in the same pull request as the code it gates, with git history as the record and no console state to keep in sync.
- You want flag evaluation with no initialize request and no SDK key. @dif.sh/sdk has no dependencies and assigns by hashing the user ID with SHA-256.
- You want the hypothesis, owner, primary metric and decision stored in the flag file, and dif conclude to append the learning to dif/surfaces/<name>.md.
- You want CI to fail when two active experiments target one surface without a shared exclusion_group. dif validate exits 1 with error E007.
- You already analyse experiments in your own warehouse. dif init --events custom scaffolds dif/events/exposure.ts and dif/events/track.ts, two handlers that send events where you choose.
- You want your flag definitions to outlive any vendor arrangement. They are Markdown files in your repo under an MIT toolchain.
Moving from Statsig to dif
dif has no Statsig importer. Migration is by hand, one gate or experiment at a time, and both SDKs can run side by side while you move. The migration guide linked below walks through each step with tested commands.
- List the gates, dynamic configs and experiments your code still reads. Leave in Statsig anything that needs a no-deploy switch, a JSON value or a Safeguard.
- For each gate or experiment you move, run dif new <id> --surface <name>. Copy the groups into variants and the allocation percentages into weight. Weights must sum to 100. Set status: active.
- Rewrite rule conditions as audience.include and audience.exclude on attributes declared in dif/config.yaml. A condition dif cannot express (a version comparison, a date, a regex) has to be computed in dif/audiences/<name>.ts and declared as a boolean or enum attribute.
- Replace checkGate() and getExperiment() calls with dif("<id>", { ... }) and one branch per variant. Experiment parameters become values in code inside each branch.
- Replace layers. Put the experiments on one surface and either give them the same exclusion_group, which picks by created date and does not split traffic, or include a different value of a slot attribute in each file.
- Replace holdouts with a boolean attribute you resolve and an audience.exclude in every file the holdout covers. dif records nothing about the holdout group.
- Send exposures to your warehouse from dif/events/exposure.ts, or connect Dif Cloud. Without one of the two you have assignment and no results.
- Run dif validate, then dif build. Add "prebuild": "dif build" to package.json, because dif/generated/ is gitignored. Remove each Statsig call site as its flag lands.
Related posts
Sources
Every Statsig claim on this page comes from one of these pages. Pricing and features change; the date is when we read each one.
- Statsig pricing page read Oct 7, 2026
- Statsig docs: Feature Flags overview read Oct 7, 2026
- Statsig docs: Server SDKs introduction read Oct 7, 2026
- Statsig docs: Client SDKs introduction read Oct 7, 2026
- Statsig docs: Client vs Server SDKs read Oct 7, 2026
- Statsig docs: SDK Getting Started read Oct 7, 2026
- Statsig docs: Statistical methods introduction read Oct 7, 2026
- Statsig docs: Dynamic Config overview read Oct 7, 2026
- Statsig docs: Feature gate conditions read Oct 7, 2026
- Statsig docs: Create a Safeguard read Oct 7, 2026
- Statsig docs: Holdouts introduction read Oct 7, 2026
- Statsig docs: About Warehouse Native read Oct 7, 2026
- Statsig docs: MCP server overview read Oct 7, 2026
- Statsig docs llms.txt read Oct 7, 2026
- statsig-io/statsig-server-core repository read Oct 7, 2026
- statsig-io/js-client-monorepo repository read Oct 7, 2026
- Amplitude blog: Amplitude and Statsig Partnership (2026-05-05) read Oct 7, 2026