This document describes the basic concepts of Flipt.
Settings
section of the Flipt UI:
new-contact-page
could be used to determine whether
or not a given user sees the latest version of a ‘Contact Us’ page that you are
working on when they visit your homepage.
Flags can be used as simple on/off toggles or with variants and rules to support
more elaborate use cases.
colorscheme
that determines which main colors your users see when they login to your
application, then possible variants could include dark
, light
or auto
.
true
or false
respectively. Boolean flags work well for simple use cases where you don’t need to return multiple variants.
Boolean flags can be configured with rollout rules to determine which entities receive true
or false
for a given flag.
String
, Number
, Boolean
Array
, Object
new-users
.
Match Type
of either:
new-users
segment, you may want
to check their finished_onboarding
property.
true
or false
2020-01-01
or 2020-01-01T00:00:00Z
(RFC3339)entityId
that was sent in the body of the Variant
or Boolean
requestIF IN segment THEN RETURN variant_a
or they can be
richer by using distribution logic to roll out features on a percentage basis.
Continuing our previous example, we may want to return the flag variant dark
for all entities in the new-users
segment. This would be configured like so:
dark
variant to your new-users
segment, you want to show dark
to 10% of new-users
, light
to 30%, and auto
to the remaining 60%. You would accomplish this using rules with distributions:
true
or false
for a given percentage of entities.true
or false
if an entity matches a given segment.new-user
, and which color
(dark
, auto
, or light
) that they should see for their main color scheme.
entity
in the Flipt
ecosystem. More often than not this will be a user, but we didn’t want to make
any assumptions about how your application works, which is why entity
was chosen.
entityId
and it’s a
simple string. It’s up to you what that entityId
is.
It could be a:
context
is a simple map of key-value pairs where the key is the
property to match against all constraints, and the value is what’s compared.
flagKey
, entityID
and context
. This is what allows Flipt to return the same variant every time (also sometimes referred to as stickiness).
flagKey
and entityID
and concatenates them together to
form a string that looks like flagKey:entityID
. This is called the key.A
and B
.
If distribution A
has a 30% ‘rollout’, then it would ‘take up’ buckets 0‐299 (out of the 1000 buckets). Distribution B
would take up the remaining buckets 300‐999.
The flagKey/entityID
hashed value is a 32bit integer on which Flipt performs a modulo operation (% 1000) so that it ‘s guaranteed to return a number between 0‐999.
The result of the modulo operation is then used to determine which distribution to return via the bucket mapping. If the result is between 0‐299, then distribution A
is returned, otherwise distribution B
is returned.