Getting started
Flagmage is designed to make managing and tracking feature flags as easy as possible. By defining everything using git, it is easy to enable, review, and, even, rollback feature flag changes.
Authorize Github app
Flagmage is installed at the org-level, and feature flags are aggregated across all authorized repositories. This provides flexibility for the user to organize their flags either in a single monorepo, multiple repos for microservices, or even a configuration-only repository. As a new feature flag is created or updated, that flag is combined with the existing flags using a "last update wins" rule in case of any naming collisions.
To get started with authorizing, TODO.
Create first feature flag
Get started by creating a new directory, .flagmage
in the root level of any repository that was authorized with the Flagmage Github app.
All files in this directory must contain valid json configurations representing a feature flag. All valid configuration options can be found here (TODO). The name of the file corresponds to the name of the feature flag. For example, create a new file, enable_new_homepage.json
with the following json:
{
"default_value": false
}
Given this configuration, when the enable_new_homepage
feature flag gets resolved, it will always be false
. To allow certain users to gain access to the feature, a variant
must be included:
{
"default_value": false,
"variants": [
{
"value": true,
"enabled_ids": [1337]
}
]
}
With this configuration, when a request is made with id: 1337
, the return value will be true
! All other requests will be false. See here (TODO) for all options for variants
.
While most apps will make requests using either user ids or organized ids, Flagmage does not dictate what these ids relate to.
Commit your changes
Now that the change is ready, commit it and merge to the main branch of your repository. If the Flagmage Github app is properly integrated, there will be a message on your app saying it was successfully parsed and uploaded.
TODO Show image of Github
Making requests
After the feature flag has been commited, it can now be integrated with your application code.
TODO