Skip to content

Instantly share code, notes, and snippets.

@larkintuckerllc
Created March 8, 2022 15:39
Show Gist options
  • Save larkintuckerllc/202183fbee7d99694b60bcfad5de4aa8 to your computer and use it in GitHub Desktop.
Save larkintuckerllc/202183fbee7d99694b60bcfad5de4aa8 to your computer and use it in GitHub Desktop.
import {
createApiFactory,
createPlugin,
createRoutableExtension,
discoveryApiRef,
identityApiRef,
} from '@backstage/core-plugin-api';
import { MyPluginBackendClient } from './api/MyPluginBackendClient';
import { myPluginApiRef } from './api/types';
import { rootCatalogMyPluginRouteRef } from './routes';
export const myPluginPlugin = createPlugin({
id: 'my-plugin',
apis: [
createApiFactory({
api: myPluginApiRef,
deps: {
discoveryApi: discoveryApiRef,
identityApi: identityApiRef,
},
factory: ({ discoveryApi, identityApi }) =>
new MyPluginBackendClient({ discoveryApi, identityApi }),
}),
],
routes: {
root: rootCatalogMyPluginRouteRef,
},
});
export const EntityMyPluginContent = myPluginPlugin.provide(
createRoutableExtension({
name: 'EntityMyPluginContent',
component: () =>
import('./components/ExampleComponent').then(m => m.ExampleComponent),
mountPoint: rootCatalogMyPluginRouteRef,
}),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment