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:
enableAccountDeletionenableOrganizationDeletionenablePersonalAccountenableOrganizationsenablePersonalAccountBillingenableOrganizationsBillingallowUserToCreateOrganizationshowAccountSwitcherenableThemeToggleenableVersionUpdaterenableCustomRolesmaxRolesPerOrganization
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_TOGGLENEXT_PUBLIC_ENABLE_VERSION_UPDATERNEXT_PUBLIC_ENABLE_CUSTOM_ROLESNEXT_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 isfeaturesFlag - assuming every account-mode-derived flag can be overridden independently
- assuming
maxRolesPerOrganizationis available fromfeaturesFlagtoday