From 40f557c2e497855dcaf1ddfecb854a3d08927896 Mon Sep 17 00:00:00 2001 From: aramissennyeydd Date: Mon, 8 Apr 2024 21:36:19 -0400 Subject: [PATCH] small update Signed-off-by: aramissennyeydd --- docs/plugins/backend-plugin.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/plugins/backend-plugin.md b/docs/plugins/backend-plugin.md index 24b6a76fbc..9951b67b18 100644 --- a/docs/plugins/backend-plugin.md +++ b/docs/plugins/backend-plugin.md @@ -181,6 +181,25 @@ In the new backend, dependencies are defined statically during registration and }, ``` +You can add your own dependencies by adding a named item to the `deps` parameter: + +```ts +deps: { + // highlight-next-line + myDependency: coreServices.rootConfig, +}, +``` + +And then you can access it by referencing it in the `init` block of your plugin definition, + +```ts +async init({ myDependency }) { + // .. +} +``` + +And then you're free to call it and pass it into your router as needed. + Backstage provides a bunch of `coreServices` out of box: - **Database**: A database connection layer using knex.