Skip to main content

FeatureFlagsApi

Home > @backstage/core-plugin-api > FeatureFlagsApi

The feature flags API is used to toggle functionality to users across plugins and Backstage.

Signature:

export interface FeatureFlagsApi 

Remarks

Plugins can use this API to register feature flags that they have available for users to enable/disable, and this API will centralize the current user's state of which feature flags they would like to enable.

This is ideal for Backstage plugins, as well as your own App, to trial incomplete or unstable upcoming features. Although there will be a common interface for users to enable and disable feature flags, this API acts as another way to enable/disable.

Methods

MethodDescription
getRegisteredFlags()Get a list of all registered flags.
isActive(name)Whether the feature flag with the given name is currently activated for the user.
registerFlag(flag)Registers a new feature flag. Once a feature flag has been registered it can be toggled by users, and read back to enable or disable features.
save(options)Save the user's choice of feature flag states.