Skip to main content

ServiceRef

Home > @backstage/backend-plugin-api > ServiceRef

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

Signature:

export type ServiceRef<TService, TScope extends 'root' | 'plugin' = 'root' | 'plugin', TInstances extends 'singleton' | 'multiton' = 'singleton' | 'multiton'> = {
id: string;
scope: TScope;
multiton?: TInstances extends 'multiton' ? true : false;
T: TService;
$$type: '@backstage/ServiceRef';
};