Rolling out beta functionality with Flags
What is beta rollout?
Beta functionality are typically released to select customers for early access. With Schematic, you can not only roll beta functionality out using Flags, but also subsequently entitle them into Plans you already offer your customers with no additional code changes.
Setting up a Flag
Flags are the primary building block in Schematic, and they allow you to turn features on or off without modifying application code.
To set up a Flag, do the following:
- Navigate to the Flags tab and click “Create”
- Choose a Flag name that will be visible to all users, and a Flag key, which you’ll use in your application to instrument the Flag
- Add the Flag to your application code using our
check_flag
endpoint (Follow the instructions here)
Defining a beta segment
Typically a beta group is a set of your customers that have opted into new functionality. To create one in Schematic, you will need to use Company traits.
Traits can be added to Company profiles using the Company upsert API.
Here’s an example of adding a beta
trait to a company:
Targeting your beta segment with Flag Rules
Once you’ve segmented companies within Schematic, you can set up a rule to target them.
To set up a Flag Rule, do the following:
- Navigate to your Flag
- Click “Add new rule”
- Target Companies with the trait corresponding to the beta segment
Adding a beta Flag to your application
Adding a beta flag from Schematic in your application is relatively straightforward. The following code performs a Flag check for a Flag with a key beta-flag
. Schematic only requires a Company key and a Flag key to evaluate Flag conditions, and this is possible because context associated with companies is stored within Schematic (e.g. the trait we set up above). When a check_flag
request is performed, Schematic will refer to the data already stored on the Company or User profile to evaluate Flag Rules.
Turning Flags into Plan Entitlements
Once you are ready to fully release a beta feature, you can easily convert it within Schematic so that you can add it to a plan to offer it more widely.
To convert a Flag into a Plan Entitlement, do the following:
- In the Flag view, click “Convert to feature”
- Choose the feature type (Boolean, Event-based, Trait-based) and finish the wizard
- Click “Add plan entitlement” and add to an existing Plan
You can optionally remove the Rule in the Flag view that is targeting your beta segment to ensure only those that should have access to the new functionality receive that access.