Files
twenty/packages/twenty-docs/l/it/developers/contribute/capabilities/backend-development/feature-flags.mdx
T
3dd858c91e i18n - docs translations (#16774)
Created by Github action

Pulls the latest documentation translations from Crowdin for all
supported languages:
- French (fr)
- Arabic (ar)  
- Czech (cs)
- German (de)
- Spanish (es)
- Italian (it)
- Japanese (ja)
- Korean (ko)
- Portuguese (pt)
- Romanian (ro)
- Russian (ru)
- Turkish (tr)
- Chinese (zh-CN)

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-12-23 14:26:11 +01:00

47 lines
1.1 KiB
Plaintext

---
title: Feature Flags
---
I flag delle funzionalità vengono utilizzati per nascondere funzionalità sperimentali. Per Twenty, sono impostati a livello di workspace e non a livello utente.
## Adding a new feature flag
In `FeatureFlagKey.ts` aggiungi il flag di funzionalità:
```ts
type FeatureFlagKey =
| 'IS_FEATURENAME_ENABLED'
| ...;
```
Aggiungilo anche all'enum in `feature-flag.entity.ts`:
```ts
enum FeatureFlagKeys {
IsFeatureNameEnabled = 'IS_FEATURENAME_ENABLED',
...
}
```
Per applicare un flag di funzionalità su una funzione **backend** usa:
```ts
@Gate({
featureFlag: 'IS_FEATURENAME_ENABLED',
})
```
Per applicare un flag di funzionalità su una funzione **frontend** usa:
```ts
const isFeatureNameEnabled = useIsFeatureEnabled('IS_FEATURENAME_ENABLED');
```
## Configura i flag delle funzionalità per il deployment
Cambia il record corrispondente nella Tabella `core.featureFlag`:
| id | chiave | workspaceId | valore |
| ------- | ------------------------ | ----------- | ------ |
| Casuale | `IS_FEATURENAME_ENABLED` | IDWorkspace | `vero` |