Overview
A variant flag serves one of a fixed set of string values. In this guide you addsearch-variant with the variants control, semantic, and hybrid, push it, and switch on the served value in code.
Steps
1
Define the flag
Config in shipd.config.go, then run shipd push. See Define flags in code for the complete file.default must be one of variants. TypeScript checks this at compile time; Go’s ShipdConfig validates it when exporting. In TypeScript, keep as const to preserve literal variants.2
Push it
3
Evaluate it
4
Choose who gets which variant
On the flag page in the dashboard, set Fallthrough to a variant, or add rules whose Serve is a variant. Click Save environment.
Create it without a config file
--variants is required with --type variant. See CLI reference.