Rollout by Percentage
Rollouts by percentage (also known as staged feature rollouts) allow you to test a new feature with a small subset of your user base. If you are happy with the feature, you can increase the percentage of users that see the feature until it is available to your entire user base.
This method increases confidence in rolling out a new feature. If issues arise, you can disable the feature flag, thus hiding the feature flag within your application.
Prerequisites
Staged rollouts only come into effect if you are getting the flags for a particular identity. If you are just retrieving the flags for an environment without passing in an identity, your user will never be included in the "% split" segment.
Before you begin, make sure you have:
-
A feature flag created in your project.
-
Your application's Flagsmith SDK integrated and configured.
-
Identifying users in your application: You must identify users so that percentage rollouts are evaluated per user. For example:
flagsmith.identify('user_123'); -
(Optional) Any user traits you want to use for more advanced segment rules.
How to Rollout by Percentage
1. Create a segment with a percentage split rule
- Go to the Segments section in the Flagsmith dashboard.
- Create a new segment.
- Add a rule defined with the % Split condition. Specify a value between 1 and 100 to define what percentage of your user base is included within this segment.
- You can optionally use the % Split rule alongside other segment rules.