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

# Feature flags

> Switching modules off per installation, and the one flag that ships disabled.

Every module can be enabled or disabled per installation. Flags are read from the
environment:

```
FEATURE_<FLAG_NAME>=true|false
```

The flag name is upper-snake-cased from the flag key — `job-distribution` becomes
`FEATURE_JOB_DISTRIBUTION`.

## The flags

| Flag                 | Environment variable         | Default | Module                                  |
| -------------------- | ---------------------------- | :-----: | --------------------------------------- |
| `recruitment`        | `FEATURE_RECRUITMENT`        |    on   | Positions, pipeline, applications       |
| `employee-lifecycle` | `FEATURE_EMPLOYEE_LIFECYCLE` |    on   | Employee records, absence, time         |
| `feedback`           | `FEATURE_FEEDBACK`           |    on   | Feedback cycles and continuous feedback |
| `surveys`            | `FEATURE_SURVEYS`            |    on   | Employee surveys                        |
| `decision-making`    | `FEATURE_DECISION_MAKING`    |    on   | Decision methods                        |
| `budgeting`          | `FEATURE_BUDGETING`          |    on   | Budgets, forecasts, proposals           |
| `expenses`           | `FEATURE_EXPENSES`           |    on   | Expense reports                         |
| `contracts`          | `FEATURE_CONTRACTS`          |    on   | Contract templates and signing          |
| `certificates`       | `FEATURE_CERTIFICATES`       |    on   | Work certificates                       |
| `preboarding`        | `FEATURE_PREBOARDING`        |    on   | Pre-boarding journeys                   |
| `bexio-sync`         | `FEATURE_BEXIO_SYNC`         |    on   | bexio integration                       |
| `job-distribution`   | `FEATURE_JOB_DISTRIBUTION`   |    on   | SECO Job-Room and multi-channel posting |
| `ai-features`        | `FEATURE_AI_FEATURES`        |    on   | AI surfaces generally                   |
| `semantic-search`    | `FEATURE_SEMANTIC_SEARCH`    |    on   | Embeddings, sentiment, reasoning        |
| `observability`      | `FEATURE_OBSERVABILITY`      |    on   | Observability dashboard                 |
| `multi-legal-entity` | `FEATURE_MULTI_LEGAL_ENTITY` | **off** | Multiple Rechtsträger within the tenant |

## Resolution

<Steps>
  <Step title="Environment variable">
    `FEATURE_<NAME>` — `true` or `1` enables, anything else disables. The env value is
    authoritative when present.
  </Step>

  <Step title="The default">
    Every module flag defaults **on**, except `multi-legal-entity`.
  </Step>
</Steps>

## Why `multi-legal-entity` is different

A single-employer installation keeps one invisible default legal entity and must never
see the entity-management UI. Defaulting it on would surface an empty, confusing
surface on every installation that does not need it.

Turn it on deliberately, per installation, when the customer genuinely employs through
more than one Rechtsträger. Enabling the flag does not migrate anything — existing
records stay on the default entity until you assign them. See
[Legal entities](/concepts/legal-entities).

## Flags versus menu configuration

Two different tools:

| Tool               | Effect                                                       |
| ------------------ | ------------------------------------------------------------ |
| Feature flag       | The module is **off**. Routes, jobs and surfaces do not run. |
| Menu configuration | The module is on but **hidden** from the navigation.         |

Use the flag when the customer does not have the module. Use menu configuration when
they have it but do not want it in the way.

## Turning a flag off on a live installation

<Warning>
  Disabling a module hides its surfaces; it does not delete its data. Scheduled jobs for a disabled
  module stop, which is usually what you want — but check whether anything is mid-flight first.
  Disabling `recruitment` with open Stellenmeldungen, for instance, stops the sync that advances
  their embargo states.
</Warning>

## Reading flags in code

```typescript theme={null}
import { isFeatureEnabled } from "@/lib/feature-flags";

if (isFeatureEnabled("feedback")) {
  /* … */
}
```

`getAllFeatureFlags()` returns the resolved state of every flag — used by the
diagnostics surface, and useful when reproducing a customer's configuration.
