VoidhashDocs
DevelopersHelp centerGuidesAPI reference
Dashboard
Get started
Introduction
Quickstart
How Voidhash works
Glossary
Versions and releases
Concepts
Teams, projects and environments
API keys
Products and perks
Offers
Subscription lifecycle
People and identity
Groups
Events
Features
Paywalls in your app
Feature flags and A/B tests
Paywall components
Push notifications
Ad attribution in your app
Client SDKs
React Native
Swift
Kotlin
Web
Your backend
Node.js
PHP
Go
Rust
Other languages
Payment sources
Forward store notifications
Developer tools
CLI
MCP server
Query analytics with VoidQL
CLI
CLI reference
Commands
Sign-in and projects
People and access
Catalog and payments
Paywalls and components
Flags and experiments
Analytics and ads
Webhooks and push
Team and settings
Types, API and config

Flags and experiments

CLI commands to roll out feature flags and run A/B tests on paywalls.

These commands create and roll out feature flags, fix them for one person, and run A/B tests from draft to a concluded winner. Studio's Feature flags and A/B tests pages do the same.

Early access

Feature flags and A/B tests are in early access. Ask us on Discord, or email support@voidhash.com on a paid plan, to turn them on for your team.

Feature flags

CommandWhat it doesKey flags
flag listFlags with their state in production, whether test follows it, and their variants.--archived
flag view [flag]Variants, and who gets the flag in production and in test.
flag createCreates a flag, off unless you pass --rollout.--key, --type boolean|string|number|json, --variant (repeat), --description, --rollout 10%
flag enable [flag]Turns a flag on.--rollout, --env
flag disable [flag]Turns a flag off for everyone, overrides included. Asks first in production.--env
flag rollout [flag] [percent]Sets the share of people no rule names who get it. Lowering it in production asks first.--env
flag edit [flag]Changes a flag's key or description.--key, --description
flag variants set [flag] [value…]Sets exactly the values a flag hands out. Removing one asks first.
flag override [flag] [person] [setting]Fixes a flag for one person: on, off, a variant, or clear.--note, --env
flag rule add [flag] [person…]Adds a rule: the people it names and the share of them who get the flag.--rollout, --variant, --name, --id, --first, --env
flag rule remove [flag] [rule]Removes a rule by its id or name. Asks first in production when the flag is on.--env
flag promote [flag]Applies test's configuration to production, then test follows production. Asks first.
flag follow [flag]Drops test's own configuration, so test follows production again. Asks first.
flag evaluate [person]What a person gets from each flag, and why.--flag (repeat), --env
flag archive [flag]Archives a flag; apps stop receiving it. Asks first when it's on.
flag restore [flag]Restores an archived flag as it was.

Production and test

A flag decides separately in production and in test, which apps using a test key read. Test follows production until you change something in it: --env test on enable, disable, rollout, override or rule gives test a configuration of its own, started from production's. Without --env, a command changes production.

voidhash flag enable new-onboarding --rollout 100% --env test   # on for test builds only
voidhash flag override new-onboarding ada@example.com on --env test
voidhash flag promote new-onboarding                            # the same in production

flag promote copies test's switch, overrides, rules and share to production, and test follows production again. flag follow drops test's configuration without changing production.

Rules

An environment is read top to bottom: its switch, then overrides, then rules in order, then the share everyone else gets. A rule names people one by one and says what share of them get the flag, and for a flag with variants which one:

voidhash flag rule add new-checkout ada@example.com user_8231 --rollout 100% --name "Beta testers"
voidhash flag rule add new-checkout user_4411 --rollout 0% --first   # never gets it
voidhash flag rollout new-checkout 0%                                # only the named people do

A new rule is read after the ones before it; --first puts it first. flag view lists them in order.

Experiments

CommandWhat it doesKey flags
experiment listExperiments with their status and arms.--status draft|running|paused|concluded, --archived
experiment view [experiment]Status, metric and the paywall each arm shows where.
experiment createSets up a draft experiment.--name, --hypothesis, --metric (set it, such as $subscription.created), --location, --arm, --control, --weights
experiment edit [experiment]Changes its setup. Metrics change only in a draft, arms not while running.Same as create, plus --description, --secondary-metric
experiment start [experiment]Starts or resumes it at its locations. Asks first.
experiment pause [experiment]Pauses it: everyone sees the control arm.
experiment results [experiment]Each arm's conversion, with a verdict that says when it's too early to tell.
experiment conclude [experiment]Ends it for good with a winner. Shows the results and asks first.--winner (default: the control)
experiment archive [experiment]Archives a draft or concluded experiment.
experiment restore [experiment]Restores an archived experiment.

Always pass --metric, the goal event. Without it, results count purchase_completed, an event Voidhash never sends, so every arm shows 0 conversions. See Conversions for which built-in event to use.

--arm takes NAME=PAYWALL with --location, or NAME=LOCATION:PAYWALL[,LOCATION:PAYWALL]. Repeat it for each arm; the first is the control unless --control names another, and --weights 60,40 splits traffic unevenly.

Example

voidhash flag create --key new-onboarding --rollout 10%
voidhash experiment create --name "Annual first" --metric '$subscription.created' \
  --location onboarding --arm Control=pro --arm Annual=annual-first

Next steps

  • How a flag decides: environments, overrides, rules and rollouts.
  • A/B test results: conversions and verdicts.
  • Analytics and ads: measure the results.

Something wrong or missing on this page? Tell us by email or on Discord.

PreviousPaywalls and componentsNextAnalytics and ads

On this page

Feature flagsProduction and testRulesExperimentsExampleNext steps