feat: signals plugins

next try after #18153 without any external dependencies and only
supporting websocket. missing tests and necessary documentation but will
work on those after initial comments if this would be proper way to go
forward. already planning for the notification plugins on top of this.

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2023-12-04 12:36:50 +02:00
parent 04d94dc3d0
commit 047beadd9d
38 changed files with 1308 additions and 7 deletions
+31
View File
@@ -0,0 +1,31 @@
# signals
Welcome to the signals backend plugin!
Signals plugin allows backend plugins to publish messages to frontend plugins.
## Getting started
Add Signals router to your backend in `packages/backend/src/plugins/signals.ts`:
```ts
import { Router } from 'express';
import { createRouter } from '@backstage/plugin-signals-backend';
import { SignalsService } from '@backstage/plugin-signals-node';
import { PluginEnvironment } from '../types';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const service = SignalsService.create({
logger: env.logger,
identity: env.identity,
eventBroker: env.eventBroker,
});
return await createRouter({
logger: env.logger,
service,
});
}
```