docs/frontend-system: update existing usage of ApiBlueprint

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-07-29 10:31:58 +02:00
parent 781716d247
commit d6764eed83
5 changed files with 12 additions and 23 deletions
@@ -45,7 +45,6 @@ The plugin itself now wants to provide this API and its default implementation,
```tsx title="in @internal/plugin-example"
import {
ApiBlueprint,
createApiFactory,
createFrontendPlugin,
storageApiRef,
StorageApi,
@@ -63,15 +62,14 @@ class WorkImpl implements WorkApi {
const workApi = ApiBlueprint.make({
name: 'work',
params: {
factory: createApiFactory({
params: define =>
define({
api: workApiRef,
deps: { storageApi: storageApiRef },
factory: ({ storageApi }) => {
return new WorkImpl({ storageApi });
},
}),
},
});
/**
@@ -46,14 +46,13 @@ Your utility APIs can depend on other utility APIs in their factories. You do th
import {
configApiRef,
ApiBlueprint,
createApiFactory,
discoveryApiRef,
} from '@backstage/frontend-plugin-api';
import { MyApiImpl } from './MyApiImpl';
const myApi = ApiBlueprint.make({
params: {
factory: createApiFactory({
params: define =>
define({
api: myApiRef,
deps: {
configApi: configApiRef,
@@ -63,7 +62,6 @@ const myApi = ApiBlueprint.make({
return new MyApiImpl({ configApi, discoveryApi });
},
}),
},
});
```