Skip to main content

Overview

Number and JSON flags serve values instead of on/off. In this guide you add max-retries (a number) and checkout-payload (a JSON object), push them, and read them in code.

Define them

For Go, add definitions to Config in shipd.config.go, then run shipd push. See Define flags in code for the complete file.

Read a number

In React, use useNumber("max-retries"). See React bindings. See getNumber.

Read JSON

In React, use useJson("checkout-payload"). Code against that shape and keep values served from the dashboard compatible with it. See getJson.

Change the value

On the flag page in the dashboard, set Fallthrough to a new value, or add a rule that serves a different value to some users. Click Save environment.