183d034716
Reorganizing by Feature sections Capabilities folders to give an overview of each feature How-Tos folders to give guidance for advanced customizations Reorganized the Developers section as well, moving the API sub section there added some new visuals and videos to illustrate the How-Tos articles checked the typos, the links and added a section at the end of the doc.json file to redirect existing links to the new ones (SEO purpose + continuity of the user experience) What I have not updated is the "l" folder that, per my understanding, contains the translation of the User Guide - that I only edited in English <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is generating a summary for commit 5301502a32856e5b45d7ef30253fa7db6dc55233. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: github-actions <github-actions@twenty.com> Co-authored-by: Abdul Rahman <ar5438376@gmail.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
52 lines
1.0 KiB
Plaintext
52 lines
1.0 KiB
Plaintext
---
|
|
title: Feature Flags
|
|
---
|
|
|
|
|
|
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:
|
|
|
|
```ts
|
|
type FeatureFlagKey =
|
|
| 'IS_FEATURENAME_ENABLED'
|
|
| ...;
|
|
```
|
|
|
|
Also add it to the enum in `feature-flag.entity.ts`:
|
|
|
|
```ts
|
|
enum FeatureFlagKeys {
|
|
IsFeatureNameEnabled = 'IS_FEATURENAME_ENABLED',
|
|
...
|
|
}
|
|
```
|
|
|
|
|
|
|
|
To apply a feature flag on a **backend** feature use:
|
|
|
|
```ts
|
|
@Gate({
|
|
featureFlag: 'IS_FEATURENAME_ENABLED',
|
|
})
|
|
```
|
|
|
|
To apply a feature flag on a **frontend** feature use:
|
|
|
|
```ts
|
|
const isFeatureNameEnabled = useIsFeatureEnabled('IS_FEATURENAME_ENABLED');
|
|
```
|
|
|
|
|
|
## Configure feature flags for the deployment
|
|
|
|
Change the corresponding record in the Table `core.featureFlag`:
|
|
|
|
| id | key | workspaceId | value |
|
|
|----------|--------------------------|---------------|--------|
|
|
| Random | `IS_FEATURENAME_ENABLED` | WorkspaceID | `true` |
|
|
|