-
Notifications
You must be signed in to change notification settings - Fork 21
Feature Flags
Nick Watts edited this page Sep 20, 2022
·
6 revisions
To add a feature flag, add an entry to the list in src/libs/feature-previews-config.js.
Each entry should contain an object with the keys:
- id: A unique ID for the feature
- title: A short label for the feature
- description: A longer description for the feature
- groups (optional): A list containing names of Terra groups for which the feature is available
- documentationUrl (optional): Link to documentation for the feature
- feedbackUrl (optional): Link to submit feedback for the feature
To check if a feature preview is enabled, call isFeaturePreviewEnabled
(imported from src/libs/feature-previews.js) and pass it the ID of the feature.
isFeaturePreviewEnabled('my-feature')
All features listed in feature-previews-config.js will be shown on the feature previews page. If a feature preview is configured with groups, the feature will only be shown if the user is a member of one of the groups.
To enable/disable a feature outside of the feature preview page, use the toggleFeaturePreview
function imported from src/libs/feature-previews.js.
toggleFeaturePreview('my-feature', true)
Terra UI Wiki.
- Getting Started
- Contributor Guide
- Intro to UI Development
- Troubleshooting Build Failures
- Editor Configuration
- BEEs
- Pull Requests
- How to Find a PR Site
- Feature Flags
- Mixpanel
- Cobranding and White-Label Sites
- Using Terra UI packages in other projects