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

# Local Feature Flags

> Development and test feature flag provider that enables every flag.

**Local feature flags** are the default provider: no external account, no persistence, and every `isEnabled()` call returns `true`.

<details>
  <summary>🤖 Agent context</summary>

  Config schema: `featureFlagConfigSchema` in `apps/shared/src/featureFlags/schema.ts`. Loader: `apps/backend/src/tools/featureFlags/loader.ts` resolves `FeatureFlagClientType.LOCAL` and dynamic-imports `tooling-feature-flags-local`. Implementation: `apps/tools/featureFlags/local/src/index.ts`.

  Used by default in `development.ts`, `staging.ts`, and `test.ts`. Do not use in production.

  ❌ Never configure `FeatureFlagClientType.LOCAL` in `production.ts`.
  ❌ Do not expect `getAll()` to return flag metadata — LOCAL always returns `{}`.
  ❌ Do not add SDK calls to the LOCAL adapter.

  Verify with: `make test module=tooling-feature-flags-local` and `make test module=backend path=apps/backend/src/tools/featureFlags/__tests__/loader.spec.ts`
</details>

## Why

Local flags keep development unblocked: backend code can call `tools.featureFlags` without provisioning PostHog or LaunchDarkly projects. Tests stay deterministic because every flag evaluates to enabled.

## Setup

```ts theme={null}
featureFlags: {
  client: FeatureFlagClientType.LOCAL,
  cacheMs: 30_000,
  exposedFlags: [],
},
```

No extra services or environment variables are required.

## Behavior

| Method | Result |
| - | - |
| `isEnabled(key)` | `true` |
| `getVariant(key)` | `null` |
| `getAll()` | `{}` |
| `preload()` | no-op |

## Gotchas

* `getAll()` is empty even though `isEnabled()` is always true — callers must not assume the cache contains every key.
* `exposedFlags` still gates GraphQL output; an empty list means `me.featureFlags` returns `[]`.

## What's next?

* [Feature flags overview](/tooling/feature-flags/overview)
* [PostHog provider](/tooling/feature-flags/posthog)
* [Configuration system](/architecture/configuration-system)
