# Feature management

A front-end feature-flag rules engine — serve feature variations to users, subscriptions, or pages based on tracked context, with gradual rollout.

Feature Management is a front-end **feature-flag rules engine**. You define a flag, the **variations** it can serve, and **rules** that decide which variation each user gets — matched against the tracked context Foldspace already collects: **user** attributes, **subscription** attributes, and the **page URL**. Because targeting runs on tracked data, you can turn a feature on for a specific group, roll it out gradually, and test it before it ships.

Each flag has a **Variant Key** (for example, `sdk_config_block_email`) that your front end reads through the SDK to decide whether a feature is on. Flags are scoped to a **Product** and **Environment** (for example, Prod), and the whole flag can be toggled on or off.

## Variations

A flag's **variations** are the values it can serve. Pick a **Type** (for example, **Boolean**), then define each variation with a **Name**, **Value**, and optional **Description** — for example `SDK config block email is ON` = `true` and `SDK config block email is OFF` = `false`.

**Default Variations** set what's served when no rule matches:

- **Status OFF** — the variation served when the flag is disabled.
- **Status ON** — the variation served when the flag is enabled.

## Rules

Under **Segments**, you build the **rules** that override the default for a targeted set. Each rule is one or more conditions on tracked context, combined with **AND / OR**:

> `Users` · `Email` · `Ends With` · `@foldspace.ai`

Target on **user**, **subscription**, or **page URL** attributes. Then set **On match serve**:

- **Variations** — serve one specific variation to everyone the rule matches.
- **Rollout** — split matched traffic across variations by percentage (for example, 100% / 0%), so you can **roll out gradually** and widen over time.

### Example rule

Serve the "ON" variation to your internal team by matching users whose **Email** **Ends With** `@foldspace.ai` **OR** `@eucera.ai` **OR** `@eucera.io`, with **On match serve → Variations → SDK config block email is ON**. Switch **On match serve** to **Rollout** to ramp that same audience from a small percentage up to 100%.

## Test before you ship

The **Test Feature** tab evaluates the flag against data you pass in, so you can confirm which variation a given user, subscription, or page would receive before the rule goes live. **History** records changes to the flag, and **Settings** holds its configuration.
