Files
twenty/packages/twenty-docs/l/ca/developers/backend-development/feature-flags.mdx
T
8cadd00d34 i18n - translations (#15799)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-11-13 16:34:00 +01:00

52 lines
1.1 KiB
Plaintext

---
title: Feature Flags
image: /images/user-guide/table-views/table.png
---
<Frame>
<img src="/images/user-guide/table-views/table.png" alt="Header" />
</Frame>
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'
| ...;
```
També afegiu-lo a l'enum en `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
Canvia el registre corresponent a la Taula `core.featureFlag`:
| identificador | clau | workspaceId | valor |
| ------------- | ------------------------ | ----------- | ------ |
| Aleatori | `IS_FEATURENAME_ENABLED` | WorkspaceID | `cert` |