Feature Flags
Feature Flags
Control which features are available to which instances with typed variants, CEL targeting rules, and OpenFeature compatibility.
What are feature flags?
Feature flags in Kaiten let you control which features are available to which instances — without redeploying your application. Kaiten flags support typed variants, CEL-based targeting rules, and OpenFeature compatibility.
Feature Flag: "delivery-tracking-enabled"
├── Type: boolean
├── Variants: on (true), off (false)
├── Default: off
├── Targeting Rules:
│ └── "Delivery tracking entitlement granted"
│ __kaiten.entitlements['delivery-tracking'] == true → on
└── Evaluation: POST /ofrep/v1/evaluate/flags/delivery-tracking-enabledThe rule reads the License instead of naming customers: Sakura Tokyo and Kappa Kyoto, on Premium, resolve to on; Ninja Osaka, on Starter, and Demo Restaurant, on the first version of Standard, resolve to off.
Key capabilities
| Capability | Description |
|---|---|
| Typed variants | boolean for on/off toggles, string and number for named modes and limits, object for structured configuration (A/B tests, gradual rollouts) |
| CEL targeting | Write rules using Common Expression Language to target specific instances |
| OpenFeature (OFREP) | Standard evaluation protocol — use any OpenFeature SDK, no vendor lock-in |
| Per-instance evaluation | Each flag resolves independently based on the calling instance's context |
| Master switch | Disable a flag globally — always returns the default variant regardless of rules |
How it works
- Create a flag with variants (the possible values it can resolve to)
- Define targeting rules using CEL expressions to match instances
- Evaluate the flag via OFREP — Kaiten resolves the correct variant for the given context
- React in your application based on the returned variant value
Evaluation request (context: { targetingKey: "sakura-tokyo", kaiten: { instanceSlug: "sakura-tokyo-prod" } })
│
├── Is flag enabled? → Yes
├── Rule 1: __kaiten.entitlements['delivery-tracking'] == true
│ Premium grants delivery-tracking → MATCH → variant "on"
│
└── Response: { key: "delivery-tracking-enabled", variant: "on", value: true, reason: "TARGETING_MATCH" }Feature flags are organization-scoped — each organization manages its own flags independently.
In this section
Create & Manage
Create, update, and delete feature flags via the API or the console.
Variants
Boolean toggles and object variants for structured feature configuration.
Targeting Rules
Write CEL expressions to control which instances receive which variants.
OpenFeature & OFREP
Evaluate flags via the standard OpenFeature protocol with any SDK.
API endpoints overview
CRUD
| Method | Endpoint | Description |
|---|---|---|
GET | /api/feature-flags | List all feature flags |
POST | /api/feature-flags | Create a feature flag |
GET | /api/feature-flags/{slug} | Get a feature flag |
PUT | /api/feature-flags/{slug} | Replace a feature flag's definition |
DELETE | /api/feature-flags/{slug} | Delete a feature flag |
Evaluation (OFREP)
| Method | Endpoint | Description |
|---|---|---|
POST | /api/ofrep/v1/evaluate/flags/{key} | Evaluate a single flag |
POST | /api/ofrep/v1/evaluate/flags | Bulk evaluate all flags |
OpenFeature
| Method | Endpoint | Description |
|---|---|---|
GET | /api/openfeature/v0/manifest | Get the OpenFeature flag manifest |
Events
Every feature flag mutation emits a domain event via the transactional outbox, and each evaluation is recorded as one too, for the organization and best effort:
| Event name | Event type |
|---|---|
FEATURE_FLAG_CREATED | com.kaiten.feature_flag.v1.created |
FEATURE_FLAG_UPDATED | com.kaiten.feature_flag.v1.updated |
FEATURE_FLAG_DELETED | com.kaiten.feature_flag.v1.deleted |
FEATURE_FLAG_EVALUATED | com.kaiten.feature_flag.v1.evaluated |