Demo walkthrough
This walkthrough is designed to follow along in the Unleash demo instance. It takes you from a simple on/off flag to targeted rollouts for specific users and percentages, using pre-configured feature flags in the demo project.
The demo instance is a shared environment with limited features. For the best experience with the full feature set and your own applications, we recommend that you start a free 14-day Unleash Enterprise trial instead.
Open the demo app
Before you begin, open the demo app in a separate tab. You’ll use it to see your changes take effect in real time.
Scan the QR code with your phone or open hello.unleash.run in another tab. For the best experience, keep the demo app and the Unleash instance side by side.
Enable a feature flag
Feature flags are the central concept of Unleash. They let you turn features on or off for your users without redeploying code.
Toggle the dev environment switch to on to enable the flag for everyone in development.
Feature flags are always evaluated per environment. Enabling a flag in dev does not affect production.
Enable a flag for a specific user
Activation strategies give you fine-grained control over when and for whom a feature is enabled. Here, you’ll use a constraint to target a specific user by their userId.
In the dev environment, click Add strategy > Default strategy > Configure. In the Targeting tab, go to the Constraints section and click Add constraint.
Multiple strategies on the same flag use OR logic: the flag activates if any strategy evaluates to true. Constraints within a single strategy use AND logic: all constraints must be met for that strategy to activate.
Roll out to a percentage of users
Use a gradual rollout to safely expose a feature to a portion of your user base.
Gradual rollout relies on stickiness: a concept that uses a hash of the userId (or sessionId, or a random value) to decide whether a user falls within the rollout percentage. This means the same user always gets the same experience, even across sessions.
Change the UI with variant payloads
Variants extend what a feature flag returns beyond a simple on/off. Each variant has a name, a weight (how often it’s shown), and an optional payload.
Go to the Variants tab and click Add variant. Give the variant a name, set the payload type to String, and enter a hex color value as the payload, for example #6366f1.
Your userId always maps to the same variant, so you will only see one of the two colors. To see the other variant, open the demo app in a different browser or an incognito window. This generates a new userId, but since it is still a 50/50 split, you may need to try a few times.