Skip to main content


Home > @backstage/core-plugin-api

Core API used by Backstage plugins


FeatureFlagStateEnum representing the state of a feature flag (inactive/active).
SessionStateSession state values passed to subscribers of the SessionApi.


attachComponentData(component, type, data)Stores data related to a component in a global store.
createApiFactory(factory)Used to infer types for a standalone ApiFactory that isn't immediately passed to another function.
createApiFactory(api, instance)Used to infer types for a standalone ApiFactory that isn't immediately passed to another function.
createApiRef(config)Creates a reference to an API.
createComponentExtension(options)Plain React component extension.
createExternalRouteRef(options)Creates a route descriptor, to be later bound to a concrete route by the app. Used to implement cross-plugin route references.
createPlugin(config)Creates Backstage Plugin from config.
createReactExtension(options)Used by createComponentExtension() and createRoutableExtension().
createRoutableExtension(options)Extension for components that can have its own URL route (top-level pages, tabs etc.).
createRouteRef(config)Create a RouteRef from a route descriptor.
createSubRouteRef(config)Create a SubRouteRef from a route descriptor.
getComponentData(node, type)Retrieves data attached to a component.
useAnalytics()Gets a pre-configured analytics tracker.
useApi(apiRef)React hook for retrieving APIs.
useApiHolder()React hook for retrieving ApiHolder, an API catalog.
useElementFilter(node, filterFn, dependencies)useElementFilter is a utility that helps you narrow down and retrieve data from a React element tree, typically operating on the children property passed in to a component.
useRouteRef(routeRef)React hook for constructing URLs to routes.
useRouteRef(routeRef)React hook for constructing URLs to routes.
useRouteRefParams(_routeRef)React hook for retrieving dynamic params from the current URL.
withApis(apis)Wrapper for giving component an API context.


ElementCollectionA querying interface tailored to traversing a set of selected React elements and extracting data.
FeatureFlagsApiThe feature flags API is used to toggle functionality to users across plugins and Backstage.
StorageApiProvides a key-value persistence API.


alertApiRefThe ApiRef of AlertApi.
analyticsApiRefThe ApiRef of AnalyticsApi.
AnalyticsContextProvides components in the child react tree an Analytics Context, ensuring all analytics events captured within the context have relevant attributes.
appThemeApiRefThe ApiRef of AppThemeApi.
atlassianAuthApiRefProvides authentication towards Atlassian APIs.
bitbucketAuthApiRefProvides authentication towards Bitbucket APIs.
bitbucketServerAuthApiRefProvides authentication towards Bitbucket Server APIs.
configApiRefThe ApiRef of ConfigApi.
discoveryApiRefThe ApiRef of DiscoveryApi.
errorApiRefThe ApiRef of ErrorApi.
featureFlagsApiRefThe ApiRef of FeatureFlagsApi.
fetchApiRefThe ApiRef of FetchApi.
githubAuthApiRefProvides authentication towards GitHub APIs.
gitlabAuthApiRefProvides authentication towards GitLab APIs.
googleAuthApiRefProvides authentication towards Google APIs and identities.
identityApiRefThe ApiRef of IdentityApi.
microsoftAuthApiRefProvides authentication towards Microsoft APIs and identities.
oauthRequestApiRefThe ApiRef of OAuthRequestApi.
oktaAuthApiRefProvides authentication towards Okta APIs.
oneloginAuthApiRefProvides authentication towards OneLogin APIs.
storageApiRefThe ApiRef of StorageApi.
useAppReact hook providing AppContext.

Type Aliases

Type AliasDescription
AlertApiThe alert API is used to report alerts to the app, and display them to the user.
AlertMessageMessage handled by the AlertApi.
AnalyticsApiThe Analytics API is used to track user behavior in a Backstage instance.
AnalyticsContextValueAnalytics context envelope.
AnalyticsEventRepresents an event worth tracking in an analytics system that could inform how users of a Backstage instance are using its features.
AnalyticsEventAttributesA structure allowing other arbitrary metadata to be provided by analytics event emitters.
AnalyticsTrackerRepresents a tracker with methods that can be called to track events in a configured analytics service.
AnyApiFactoryCatch-all ApiFactory type.
AnyApiRefCatch-all ApiRef type.
AnyExternalRoutesCatch-all type for ExternalRouteRefs.
AnyParamsCatch-all type for route params.
AnyRoutesCatch-all route type.
ApiFactoryDescribes type returning API implementations.
ApiHolderProvides lookup of APIs through their ApiRefs.
ApiRefAPI reference.
ApiRefConfigAPI reference configuration - holds an ID of the referenced API.
AppComponentsA set of replaceable core components that are part of every Backstage app.
AppContextThe central context providing runtime app specific state that plugin views want to consume.
AppThemeDescribes a theme provided by the app.
AppThemeApiThe AppThemeApi gives access to the current app theme, and allows switching to other options that have been registered as a part of the App.
AuthProviderInfoInformation about the auth provider.
AuthRequestOptionsConfiguration of an authentication request.
BackstageIdentityApiThis API provides access to the user's identity within Backstage.
BackstageIdentityResponseToken and Identity response, with the users claims in the Identity.
BackstagePluginPlugin type.
BackstageUserIdentityUser identity information within Backstage.
BootErrorPagePropsProps for the BootErrorPage component of AppComponents.
CommonAnalyticsContextCommon analytics context attributes.
ComponentLoaderLazy or synchronous retrieving of extension components.
ConfigApiThe Config API is used to provide a mechanism to access the runtime configuration of the system.
DiscoveryApiThe discovery API is used to provide a mechanism for plugins to discover the endpoint to use to talk to their backend counterpart.
ErrorApiThe error API is used to report errors to the app, and display them to the user.
ErrorApiErrorMirrors the JavaScript Error class, for the purpose of providing documentation and optional fields.
ErrorApiErrorContextProvides additional information about an error that was posted to the application.
ErrorBoundaryFallbackPropsProps for the fallback error boundary.
ExtensionPlugin extension type.
ExternalRouteRefRoute descriptor, to be later bound to a concrete route by the app. Used to implement cross-plugin route references.
FeatureFlagFeature flag descriptor.
FeatureFlagsHooksInterface for registering feature flags hooks.
FeatureFlagsSaveOptionsOptions to use when saving feature flags.
FetchApiA wrapper for the fetch API, that has additional behaviors such as the ability to automatically inject auth information where necessary.
IconComponentIconComponent is the common icon type used throughout Backstage when working with and rendering generic icons, including the app system icons.
IdentityApiThe Identity API used to identify and get information about the signed in user.
MakeSubRouteRefCreates a SubRouteRef type given the desired parameters and parent route parameters. The parameters types are merged together while ensuring that there is no overlap between the two.
MergeParamsMerges a param object type with an optional params type into a params object.
OAuthApiThis API provides access to OAuth 2 credentials. It lets you request access tokens, which can be used to act on behalf of the user when talking to APIs.
OAuthRequestApiProvides helpers for implemented OAuth login flows within Backstage.
OAuthRequesterFunction used to trigger new auth requests for a set of scopes.
OAuthRequesterOptionsDescribes how to handle auth requests. Both how to show them to the user, and what to do when the user accesses the auth request.
OAuthScopeAn array of scopes, or a scope string formatted according to the auth provider, which is typically a space separated list.
OpenIdConnectApiThis API provides access to OpenID Connect credentials. It lets you request ID tokens, which can be passed to backend services to prove the user's identity.
OptionalParamsOptional route params.
ParamKeysType describing the key type of a route parameter mapping.
ParamNamesUsed in PathParams type declaration.
ParamPartUsed in PathParams type declaration.
PathParamsThis utility type helps us infer a Param object type from a string path For example,
inferred to { bar: string, baz: string }
PendingOAuthRequestAn pending auth request for a single auth provider. The request will remain in this pending state until either reject() or trigger() is called.
PluginConfigPlugin descriptor type.
PluginFeatureFlagConfigPlugin feature flag configuration.
ProfileInfoProfile information of the user.
ProfileInfoApiThis API provides access to profile information of the user from an auth provider.
RouteFuncTS magic for handling route parameters.
RouteRefAbsolute route reference.
SessionApiThe SessionApi provides basic controls for any auth provider that is tied to a persistent session.
SignInPagePropsProps for the SignInPage component of AppComponents.
StorageValueSnapshotA snapshot in time of the current known value of a storage key.
SubRouteRefDescriptor of a route relative to an absolute RouteRef.
TypesToApiRefsWraps a type with API properties into a type holding their respective ApiRefs.