Skip to main content
Version: Next

@backstage/backend-plugin-api

Home > @backstage/backend-plugin-api

Core API used by Backstage backend plugins.

Functions

Function

Description

createBackendFeatureLoader(options)

Creates a new backend feature loader.

createBackendModule(options)

Creates a new backend module for a given plugin.

createBackendPlugin(options)

Creates a new backend plugin.

createExtensionPoint(options)

Creates a new backend extension point.

createServiceFactory(options)

Creates a root scoped service factory without options.

createServiceFactory(options)

Creates a plugin scoped service factory without options.

createServiceRef(options)

Creates a new service definition. This overload is used to create plugin scoped services.

createServiceRef(options)

Creates a new service definition. This overload is used to create root scoped services.

createServiceRef(options)

Creates a new service definition. This overload is used to create plugin scoped services.

createServiceRef(options)

Creates a new service definition. This overload is used to create root scoped services.

isDatabaseConflictError(e)

Tries to deduce whether a thrown error is a database conflict.

readSchedulerServiceTaskScheduleDefinitionFromConfig(config)

Reads a SchedulerServiceTaskScheduleDefinition from config. Expects the config not to be the root config, but the config for the definition.

resolvePackagePath(name, paths)

Resolve a path relative to the root of a package directory. Additional path arguments are resolved relative to the package dir.

This is particularly useful when you want to access assets shipped with your backend plugin package. When doing so, do not forget to include the assets in your published package by adding them to files in your package.json.

resolveSafeChildPath(base, path)

Resolves a target path from a base path while guaranteeing that the result is a path that point to or within the base path. This is useful for resolving paths from user input, as it otherwise opens up for vulnerabilities.

Interfaces

Interface

Description

AuthService

Provides token authentication and credentials management.

See the service documentation for more details.

BackendFeature

BackendModuleRegistrationPoints

The callbacks passed to the register method of a backend module.

BackendPluginRegistrationPoints

The callbacks passed to the register method of a backend plugin.

BackstageUserInfo

Represents user information that is available to the backend, based on some user credentials.

CacheService

A pre-configured, storage agnostic cache service suitable for use by Backstage plugins.

See the service documentation for more details.

CreateBackendFeatureLoaderOptions

Options for creating a new backend feature loader.

CreateBackendModuleOptions

The configuration options passed to createBackendModule().

CreateBackendPluginOptions

The configuration options passed to createBackendPlugin().

CreateExtensionPointOptions

The configuration options passed to createExtensionPoint().

DatabaseService

Manages access to databases that plugins get.

See the service documentation for more details.

DiscoveryService

The DiscoveryService is used to provide a mechanism for backend plugins to discover the endpoints for itself or other backend plugins.

See the service documentation for more details.

HttpAuthService

Provides handling of credentials in an ongoing request.

See the service documentation for more details.

HttpRouterService

Allows plugins to register HTTP routes.

See the service documentation for more details.

HttpRouterServiceAuthPolicy

Options for HttpRouterService.addAuthPolicy().

LifecycleService

Provides registration of plugin startup and shutdown lifecycle hooks.

See the service documentation for more details.

LifecycleServiceShutdownOptions

LifecycleServiceStartupOptions

LoggerService

A service that provides a logging facility.

See the service documentation for more details.

PermissionsService

Permission system integration for authorization of user/service actions.

See the permissions documentation and the service documentation for more details.

PermissionsServiceRequestOptions

Options for PermissionsService requests.

PluginMetadataService

Access metadata about the current plugin.

See the service documentation for more details.

PluginServiceFactoryOptions

RootConfigService

Provides access to static configuration.

See the configuration documentation and the service documentation for more details.

RootHealthService

RootHttpRouterService

HTTP route registration for root services.

See the service documentation for more details.

RootLifecycleService

Registration of backend startup and shutdown lifecycle hooks.

See the service documentation for more details.

RootLoggerService

Root-level logging.

See the service documentation for more details.

RootServiceFactoryOptions

SchedulerService

Deals with the scheduling of distributed tasks, for a given plugin.

See the service documentation for more details.

SchedulerServiceTaskInvocationDefinition

Options that apply to the invocation of a given task.

SchedulerServiceTaskRunner

A previously prepared task schedule, ready to be invoked.

SchedulerServiceTaskScheduleDefinition

Options that control the scheduling of a task.

SchedulerServiceTaskScheduleDefinitionConfig

Config options for SchedulerServiceTaskScheduleDefinition that control the scheduling of a task.

ServiceFactory

ServiceRefOptions

UrlReaderService

A generic interface for fetching plain data from URLs.

See the service documentation for more details.

UserInfoService

Authenticated user information retrieval.

See the service documentation for more details.

Namespaces

Namespace

Description

coreServices

All core services references

Type Aliases

Type Alias

Description

BackstageCredentials

An opaque representation of credentials, for example as passed in a request-response flow.

BackstageNonePrincipal

Represents a principal that is not authenticated (for example when no token at all was given to a request).

BackstagePrincipalAccessRestrictions

The access restrictions that apply to a given principal.

BackstagePrincipalTypes

The types of principal that can be represented in a BackstageCredentials object.

BackstageServicePrincipal

Represents a service principal (for example when an external access method token was given to a request, or the caller was a Backstage backend plugin).

BackstageUserPrincipal

Represents a user principal (for example when a user Backstage token issued by the auth backend was given to a request).

CacheServiceOptions

Options passed to CacheService.withOptions().

CacheServiceSetOptions

Options passed to CacheService.set().

ExtensionPoint

TODO

LifecycleServiceShutdownHook

LifecycleServiceStartupHook

SchedulerServiceTaskDescriptor

A semi-opaque type to describe an actively scheduled task.

SchedulerServiceTaskFunction

A function that can be called as a scheduled task.

It may optionally accept an abort signal argument. When the signal triggers, processing should abort and return as quickly as possible.

ServiceRef

A reference to a backend service. You can use these references to mark dependencies on services and having their implementations injected automatically.

UrlReaderServiceReadTreeOptions

An options object for UrlReaderService.readTree() operations.

UrlReaderServiceReadTreeResponse

A response object for UrlReaderService.readTree() operations.

UrlReaderServiceReadTreeResponseDirOptions

Options that control execution.

UrlReaderServiceReadTreeResponseFile

Represents a single file in a UrlReaderService.readTree() response.

UrlReaderServiceReadUrlOptions

An options object for readUrl operations.

UrlReaderServiceReadUrlResponse

A response object for UrlReaderService.readUrl() operations.

UrlReaderServiceSearchOptions

An options object for search operations.

UrlReaderServiceSearchResponse

The output of a search operation.

UrlReaderServiceSearchResponseFile

Represents a single file in a search response.