First Feature Flag
Ship a feature flag in under 5 minutes. This guide assumes you’ve completed the Quickstart and have @appdispatch/react-native installed.
1. Create a flag in the dashboard
Open Flags in the sidebar and click Create flag.
- Name:
New Checkout - Key:
new-checkout - Type: Boolean
- Default value:
false
Click create, then toggle the flag on for your production channel.
2. Use the flag
import { useBooleanFlagValue } from '@appdispatch/react-native'
function CheckoutButton() {
const newCheckout = useBooleanFlagValue('new-checkout', false)
if (newCheckout) {
return <NewCheckoutFlow />
}
return <LegacyCheckout />
}No additional setup needed — the SDK was already initialized in your root layout during the Quickstart.
3. Toggle it
Go back to the dashboard, toggle the flag off. Reload your app — the old checkout appears.
Toggle it on — the new checkout appears. No deploy needed.
Next steps
- Add targeting rules to roll out to a percentage of users
- Create segments for reusable audience targeting
- Configure per-environment settings to test in staging first
- Learn how the OpenFeature provider works
Last updated on