Getting started

Self-Hosting

Extending

Rest APIs
GraphQL APIs

Contributing

User Guide

Feature Flags

Feature Flags

Feature Flags
In this article

Feature flags are used to hide experimental features. For twenty they are set on workspace level and not on a user level.

Adding a new feature flag

In FeatureFlagKey.ts add the feature flag:

type FeatureFlagKey =
  | 'IS_FEATURENAME_ENABLED'
  | ...;

Also add it to the enum in feature-flag.entity.ts:

enum FeatureFlagKeys {
    IsFeatureNameEnabled = 'IS_FEATURENAME_ENABLED',
    ...
}

To apply a feature flag on a backend feature use:

@Gate({
  featureFlag: 'IS_FEATURENAME_ENABLED',
})

To apply a feature flag on a frontend feature use:

const isFeatureNameEnabled = useIsFeatureEnabled('IS_FEATURENAME_ENABLED');

Configure feature flags for the deployment

Change the corresponding record in the Table core.featureFlag:

idkeyworkspaceIdvalue
RandomIS_FEATURENAME_ENABLEDWorkspaceIDtrue

Noticed something to change?

As an open-source company, we welcome contributions through Github. Help us keep it up-to-date, accurate, and easy to understand by getting involved and sharing your ideas!

twenty github image
The #1 Open Source CRM
©2024 Twenty PBC