Skip to main content
You can create variations of your feature and decide which one to show each user, based on the criteria you define in the feature flag. A feature variation is a named combination of values assigned to your feature variables. A feature variable defines a single piece of content, such as a discount percentage or a button color, that you can update remotely without redeploying code. You define variables first, then assign their values within each variation.

Creating feature variations

You can customize any variable you create in the Variables page for any variation. You don’t need to code any values into your source code. To create a feature variation:
  1. Navigate to your feature flag or create a new one.
  2. In the left sidebar, click Set up > Variations > Add variation.
  3. Edit your variation’s Name and Variation Key.
  4. Click Save.

Default feature variations

When you create a new feature flag, Kameleoon generates two default variations: On and Off.
  • Off Variation: Users assigned to this variation see your app or website as it appears when you turn off the feature flag. This variation lets you test new features on a limited group of users. Keep in mind that any custom variables you’ve created for the feature flag won’t be available in the Off variation.
  • On Variation: The On variation presents your flagged feature’s default or control version. This variation serves as the baseline experience for your feature and will only use the default values for all defined feature variables.
Utilizing these default variations helps you manage user experience for different segments of your audience. You can view a summary of which variations Kameleoon serves to your users in the Rollout Summary.
The getVariation() method returns the variation key associated with the user.