Apply custom validation before experiment changes
Custom Hooks now check experiments as well as feature flags. A validateExperiment hook runs your team's JavaScript against the proposed experiment, including its custom field values. It can warn about or reject a creation, edit, start, or stop that breaks your rules.
Put your requirements into code
Use a validateExperiment hook to apply checks such as:
- Require a hypothesis before an experiment starts.
- Require a linked ticket when a checkout surface is selected.
- Check one custom field against another.
A hook can raise a warning that a person reviews before saving. It can also throw an error that blocks the action.
Let people finish their drafts
An experiment created in the app starts as a draft. Metrics, variations, and other settings are often added later. The hook still runs at creation, so a rule that needs those later fields could stop someone from creating the draft. If a check only matters at launch, skip drafts in your hook.
The hook also runs when an experiment stops. Check that your rules won't prevent someone from ending an experiment.
Getting started
Custom Hooks require self-hosted GrowthBook Enterprise. You also need the Custom Hooks permission to configure global or project rules.
- Open Settings → Custom Hooks and create a global or project-scoped validateExperiment hook.
- Use the built-in test interface to try draft and running inputs, then enable the hook.
Read the experiment validation hook docs.