Step 1: Creating a Segment
Start by navigating to the “Segments” tab in the console: Then click “Create New.” Lets call it “Internal Stakeholders:” There are two types of segments:- “Conditional Segments” which operate on a similar set of conditions as Feature Gates and Dynamic Configs
- ID Lists, which allow you to predetermine larger lists of userIDs or a particular customID to pass the segment.
If you wish to create multiple conditions where any of them can pass as an OR operation, you can add a new rule. ::: Don’t forget to “Save Changes” after adding those! Your Segment should look like this:
Step 2: Using a segment
Now, lets make a gate for our new feature, “Landing Page Redesign”. Navigate to “Feature Gates” and click “Create New” Since this feature isn’t ready for the public, lets gate it to our internal stakeholders using the Segment we just created. Click “Add New Rule” Again, remember to “Save Changes”Step 3: Test it!
Fill in the test gate console with any random user input. You won’t be able to get this gate to pass until you pass in a user with an email ending instatsig.com or statsig.io AND a development or staging environment like this. If you remove either of those, you should see it fail.