> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swisstools.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Feature Flags: Controlled Feature Rollouts

> Toggle features without redeploying. Use global flags for project-wide rollouts or group flags to gate features per customer, tier, or any entity you define.

Feature flags let you control which features are active in your application without touching your deployment pipeline. You define flags in the Swisstools dashboard, then check them at runtime via the API or SDK — your code branches on the result. This separates the act of shipping code from the act of releasing features, so you can merge incomplete work, test in production with a subset of traffic, or roll back instantly by flipping a toggle.

## Two types of flags

Swisstools provides two complementary flag types. Choose based on whether the flag applies to everyone or to specific entities.

<CardGroup cols={2}>
  <Card title="Global flags" icon="toggle-right" href="/feature-flags/global-flags">
    Apply project-wide. Toggle on or off for all traffic, with an optional percentage rollout to gradually expose a feature.
  </Card>

  <Card title="Group flags and records" icon="users" href="/feature-flags/groups-and-records">
    Scoped to a group you define (such as an organization or user tier). Each record in the group can have its own flag values, enabling per-customer feature gating.
  </Card>
</CardGroup>

## Authentication

The dashboard uses your session automatically — no extra configuration needed. To resolve flags programmatically from your application, you use a **project-scoped API key** passed as a bearer token. You manage API keys from the **Feature Flags → API Keys** tab in the dashboard.

<CardGroup cols={1}>
  <Card title="SDK integration" icon="code" href="/feature-flags/sdk-integration">
    Resolve all flag values for a record with a single HTTP request. Includes TypeScript examples and authentication details.
  </Card>
</CardGroup>

## How flag evaluation works

For **global flags**, the check endpoint returns the resolved `enabled` state — already accounting for the rollout dice-roll Swisstools performs for that call — alongside the configured `rollout` percentage, the `source`, and the resolved `environment`. The list/get endpoints return the stored configuration instead.

For **group flags resolved via the SDK**, Swisstools returns an object of flag keys mapped to `{ enabled, rollout, source }`, already taking per-record overrides and the rollout roll into account. If a record has no explicit value set for a flag, the group flag's default is used (`source: "group-default"`).
