Files
twenty/packages/twenty-docs/l/pt/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.2 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. Para Twenty, eles são configurados no nível do workspace e não no nível do usuário.
## Adding a new feature flag
In `FeatureFlagKey.ts` add the feature flag:
```ts
type FeatureFlagKey =
| 'IS_FEATURENAME_ENABLED'
| ...;
```
Também adicione-o ao enum em `feature-flag.entity.ts`:
```ts
enum FeatureFlagKeys {
IsFeatureNameEnabled = 'IS_FEATURENAME_ENABLED',
...
}
```
Para aplicar um sinalizador de recurso em um recurso de **backend**, use:
```ts
@Gate({
featureFlag: 'IS_FEATURENAME_ENABLED',
})
```
Para aplicar um sinalizador de recurso em um recurso de **frontend**, use:
```ts
const isFeatureNameEnabled = useIsFeatureEnabled('IS_FEATURENAME_ENABLED');
```
## Configure feature flags for the deployment
Altere o registro correspondente na Tabela `core.featureFlag`:
| iD | chave | workspaceId | valor |
| --------- | ------------------------ | --------------- | ------------ |
| Aleatório | `IS_FEATURENAME_ENABLED` | ID do Workspace | `verdadeiro` |