Feature Flags Configuration

Current feature flags exposed by the web app config.

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

Import

import { featuresFlag } from '@config/feature-flags.config';

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/config/account-mode.config.ts.

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

  • NEXT_PUBLIC_ENABLE_THEME_TOGGLE
  • NEXT_PUBLIC_ENABLE_VERSION_UPDATER
  • NEXT_PUBLIC_ENABLE_CUSTOM_ROLES
  • NEXT_PUBLIC_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

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 →