Kaiten
Getting Started

Feature Flags

Create a feature flag with targeting rules and evaluate it via the OFREP API.

Create & Evaluate a Feature Flag

Kaiten provides an OpenFeature-compatible (OFREP) feature flag engine with CEL-based targeting rules, rollout percentages, and support for boolean and object flag types.

1. Create a Boolean Feature Flag

  1. Navigate to Feature FlagsNew Flag
  2. Fill in:
    • Name: Beta Feature
    • Type: boolean
    • Variants: on (true) / off (false)
    • Default Variant: off
  3. Toggle Enabled to on
  4. Click Create
curl -X POST http://localhost:6000/api/feature-flags \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Beta Feature",
    "type": "boolean",
    "enabled": true,
    "variants": [
      {"name": "on", "value": true},
      {"name": "off", "value": false}
    ],
    "defaultVariant": {
      "type": "basic",
      "value": "off"
    }
  }'

2. Evaluate via OFREP

Use the OFREP (OpenFeature Remote Evaluation Protocol) endpoint to evaluate the flag:

curl -X POST http://localhost:6000/api/ofrep/v1/evaluate/flags/beta-feature \
  -H "Authorization: Bearer ksh_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "context": {
      "tenantSlug": "my-restaurant"
    }
  }'

Response (default variant — no targeting rules match):

{
  "key": "beta-feature",
  "value": false,
  "variant": "off",
  "reason": "DEFAULT"
}

3. Add a Targeting Rule

Add a targeting rule so the flag evaluates to on for a specific tenant:

  1. Click on Beta FeatureTargeting tab
  2. Add a new rule:
    • CEL Expression: tenantSlug == "my-restaurant"
    • Variant: on
  3. Save
curl -X PUT http://localhost:6000/api/feature-flags/beta-feature \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "targetingRules": [
      {
        "type": "basic",
        "name": "tenantSlug == \"my-restaurant\"",
        "rule": "tenantSlug == \"my-restaurant\"",
        "variant": "on"
      }
    ]
  }'

4. Re-evaluate — See the Targeting in Action

Run the same evaluation again:

curl -X POST http://localhost:6000/api/ofrep/v1/evaluate/flags/beta-feature \
  -H "Authorization: Bearer ksh_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "context": {
      "tenantSlug": "my-restaurant"
    }
  }'

Response (targeting rule matched):

{
  "key": "beta-feature",
  "value": true,
  "variant": "on",
  "reason": "TARGETING_MATCH"
}

Kaiten uses CEL (Common Expression Language) for targeting rules. You can use any context variable in your expressions. See the Feature Flag Targeting Guide for advanced patterns.

Bulk Evaluation

Evaluate multiple flags at once:

curl -X POST http://localhost:6000/api/ofrep/v1/evaluate/flags \
  -H "Authorization: Bearer ksh_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "context": {
      "tenantSlug": "my-restaurant"
    }
  }'

OpenFeature SDKs

You can also evaluate flags using OpenFeature SDKs (Go, Python, JavaScript) by configuring Kaiten as your flag provider. See:

Next Step

Connect Your Application

On this page