Skip to main content

legacyPlugin

Home > @backstage/backend-common > legacyPlugin

Helper function to create a plugin from a legacy createRouter function and register it with the http router based on the plugin id.

Signature:

legacyPlugin: (name: string, createRouterImport: Promise<{
default: LegacyCreateRouter<TransformedEnv<{
cache: import("@backstage/backend-plugin-api").CacheService;
config: import("@backstage/backend-plugin-api").RootConfigService;
database: import("@backstage/backend-plugin-api").DatabaseService;
discovery: import("@backstage/backend-plugin-api").DiscoveryService;
logger: import("@backstage/backend-plugin-api").LoggerService;
permissions: import("@backstage/backend-plugin-api").PermissionsService;
scheduler: import("@backstage/backend-plugin-api").SchedulerService;
tokenManager: import("@backstage/backend-plugin-api").TokenManagerService;
reader: import("@backstage/backend-plugin-api").UrlReaderService;
identity: import("@backstage/backend-plugin-api").IdentityService;
}, {
logger: (log: import("@backstage/backend-plugin-api").LoggerService) => import("winston").Logger;
cache: (cache: import("@backstage/backend-plugin-api").CacheService) => import("./cache").PluginCacheManager;
}>>;
}>) => import("@backstage/backend-plugin-api").BackendFeature

Remarks

This is intended to be used by plugin authors to ease the transition to the new backend system.

Example

backend.add(legacyPlugin('kafka', import('./plugins/kafka')));