# Feature Flags Configuration

> Current feature flags exposed by the web app config.

*Canonical: https://makerkit.dev/docs/tanstack-prisma/configuration/feature-flags*

---

Feature flags are created in `apps/web/src/config/feature-flags.config.ts` and exported as `featuresFlag`.

## Import

```ts
import { featuresFlag } from '#/config/feature-flags.config.ts';
```

## Current Flags

The current schema includes:

- `enableAccountDeletion`
- `enableOrganizationDeletion`
- `enablePersonalAccount`
- `enableOrganizations`
- `enablePersonalAccountBilling`
- `enableOrganizationsBilling`
- `allowUserToCreateOrganization`
- `showAccountSwitcher`
- `enableThemeToggle`
- `enableVersionUpdater`
- `enableCustomRoles`
- `maxRolesPerOrganization`

## How Values Are Derived

Most flags come from `getModeFeatureFlags()` in `apps/web/src/config/account-mode.config.ts`.

Direct env-driven overrides in the current implementation are limited to:

- `VITE_ENABLE_THEME_TOGGLE`
- `VITE_ENABLE_VERSION_UPDATER`
- `VITE_ENABLE_CUSTOM_ROLES`
- `VITE_ENABLE_PERSONAL_ACCOUNT_BILLING`

`maxRolesPerOrganization` exists in the schema but is not populated in `createFeatureFlags()`. The org-role limit is handled elsewhere in Better Auth organization config.

## Example

```ts
if (featuresFlag.enableOrganizations) {
  // render org UI
}
```

## Common Pitfalls

- importing `featureFlagsConfig`; the export is `featuresFlag`
- assuming every account-mode-derived flag can be overridden independently
- assuming `maxRolesPerOrganization` is available from `featuresFlag` today

---

**Next:** [Navigation Configuration →](./navigation)
