Feature Flags
Flag types, variants, targeting rules, evaluation engine, and OpenFeature compatibility.
Feature Flags
Kaiten provides a full-featured feature flag engine with OpenFeature (OFREP) compatibility, CEL-based targeting, and rollout strategies.
Flag Types
| Type | Variants contain | Example |
|---|---|---|
boolean | true / false values | "Enable dark mode" |
string | Arbitrary string values | "red", "blue", "control" |
number | Numeric values | 0, 1, 42 |
object | JSON objects | {"theme": "festive", "discount": 15} |
Anatomy of a Feature Flag
{
"name": "Promo Banner",
"slug": "promo-banner",
"type": "object",
"enabled": true,
"variants": [
{"name": "disabled", "value": {"enabled": false}},
{"name": "festive", "value": {"enabled": true, "message": "🍣 Free miso!"}}
],
"defaultVariant": {"type": "basic", "value": "disabled"},
"targetingRules": [
{
"type": "basic",
"rule": "tenantSlug == \"sakura-tokyo\"",
"variant": "festive"
}
]
}Default Variant Strategies
The defaultVariant determines what happens when no targeting rule matches:
| Strategy | Description |
|---|---|
basic | Always returns a specific variant |
rolloutPercentage | Distributes traffic across variants (e.g. 50/50) |
Rollout Percentage Example
{
"type": "rolloutPercentage",
"value": {
"rolloutPercentage": {
"distribution": {"on": 30, "off": 70}
}
}
}Targeting Rules (CEL)
Targeting rules use CEL (Common Expression Language) to match context variables:
tenantSlug == "sakura-tokyo"
tenantSlug == "demo" && orderCount > 100
region in ["us-east", "eu-west"]Rules are evaluated in order — the first matching rule determines the variant.
Context Variables
When evaluating a flag via OFREP, you pass a context object. Any key-value pair can be used in CEL expressions:
{
"context": {
"tenantSlug": "sakura-tokyo",
"orderCount": 42,
"region": "us-east"
}
}Evaluation via OFREP
Kaiten implements the OpenFeature Remote Evaluation Protocol:
POST /api/ofrep/v1/evaluate/flags/{flagKey}— single flagPOST /api/ofrep/v1/evaluate/flags— bulk evaluation
See OpenFeature (OFREP) for API details.
OpenFeature SDK Compatibility
Kaiten can be used as a flag provider with any OpenFeature SDK. Install an OFREP provider for your language and point it to your Kaiten API. See OpenFeature Providers.
See It in the Console
The Console lets you manage flags visually — create variants, configure targeting rules, and see how each flag evaluates in real time for a given instance.

