# @backstage/plugin-events-backend

Latest version **0.6.6** (published 2026-09-15) · Apache-2.0 license · 55.4K weekly downloads

## Install

```sh
npm install @backstage/plugin-events-backend
pnpm add @backstage/plugin-events-backend
yarn add @backstage/plugin-events-backend
bun add @backstage/plugin-events-backend
```

## Health

**Score 85/100 (A)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score; popular repo.

Warnings: pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.6.6 |
| Published | 2026-09-15 |
| First published | 2022-11-15 |
| Weekly downloads | 55.4K |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 189.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34410 |
| Maintainers | patriko, freben, marcuseide |

## Links

- npm: https://www.npmjs.com/package/@backstage/plugin-events-backend
- Repository: https://github.com/backstage/backstage
- Homepage: https://backstage.io
- npm.io page: https://npm.io/package/@backstage/plugin-events-backend

## Dependencies (11)

- [knex](https://npm.io/package/knex.md) ^3.0.0
- [express](https://npm.io/package/express.md) ^4.22.0
- [content-type](https://npm.io/package/content-type.md) ^1.0.5
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.6
- [@backstage/types](https://npm.io/package/@backstage/types.md) ^1.2.2
- [@backstage/config](https://npm.io/package/@backstage/config.md) ^1.3.9
- [@backstage/errors](https://npm.io/package/@backstage/errors.md) ^1.3.1
- [express-promise-router](https://npm.io/package/express-promise-router.md) ^4.1.0
- [@backstage/backend-plugin-api](https://npm.io/package/@backstage/backend-plugin-api.md) ^1.10.1
- [@backstage/plugin-events-node](https://npm.io/package/@backstage/plugin-events-node.md) ^0.4.26
- [@backstage/backend-openapi-utils](https://npm.io/package/@backstage/backend-openapi-utils.md) ^0.7.2

## Recent versions

- 0.6.6 (latest) — 2026-09-15
- 0.0.0-nightly-20260909022715 (nightly) — 2026-09-09
- 0.6.6-next.1 (next) — 2026-09-08
- 0.0.0-nightly-20260904022803 — 2026-09-04
- 0.0.0-nightly-20260902024315 — 2026-09-02
- 0.6.6-next.0 — 2026-09-01
- 0.6.5 — 2026-08-18
- 0.0.0-nightly-20260818023149 — 2026-08-18
- 0.0.0-nightly-20260817023522 — 2026-08-17
- 0.0.0-nightly-20260816023538 — 2026-08-16
- 0.0.0-nightly-20260815023121 — 2026-08-15
- 0.0.0-nightly-20260814030239 — 2026-08-14
- 0.0.0-nightly-20260813030414 — 2026-08-13
- 0.0.0-nightly-20260812030228 — 2026-08-12
- 0.0.0-nightly-20260811025108 — 2026-08-11
- … 1302 more at https://npm.io/package/@backstage/plugin-events-backend/versions

## README

# `@backstage/plugin-events-backend`

Welcome to the events-backend backend plugin!

This package is based on [events-node](../events-node) and its `eventsServiceRef`
that is at the core of the event support.
It provides an `eventsPlugin` (exported as `default`).

By default, the plugin ships with support to receive events via HTTP endpoints
`POST /api/events/http/{topic}` and will publish these to the `EventsService`.

HTTP ingresses can be enabled by config, or using the extension point
of the `eventsPlugin`.
Additionally, the latter allows to add a request validator
(e.g., signature verification).

## Installation

```bash
# From your Backstage root directory
yarn --cwd packages/backend add @backstage/plugin-events-backend
```

```ts
// packages/backend/src/index.ts
backend.add(import('@backstage/plugin-events-backend'));
```

## Configuration

In order to create HTTP endpoints to receive events for a certain
topic, you need to add them at your configuration:

```yaml
events:
  http:
    topics:
      - bitbucketCloud
      - github
      - whatever
```

Only those topics added to the configuration will result in
available endpoints.

The example above would result in the following endpoints:

```
POST /api/events/http/bitbucketCloud
POST /api/events/http/github
POST /api/events/http/whatever
```

You may want to use these for webhooks by SCM providers
in combination with suitable event subscribers.

However, it is not limited to these use cases.

## Use Cases

### Request Validator

```ts
import { eventsExtensionPoint } from '@backstage/plugin-events-node/alpha';

// [...]

export const eventsModuleYourFeature = createBackendModule({
  pluginId: 'events',
  moduleId: 'your-feature',
  register(env) {
    // [...]
    env.registerInit({
      deps: {
        // [...]
        events: eventsExtensionPoint,
        // [...]
      },
      async init({ /* ... */ events /*, ... */ }) {
        // [...]
        events.addHttpPostIngress({
          topic: 'your-topic',
          validator: yourValidator,
        });
      },
    });
  },
});
```

### Request Body Parse

We need to parse the request body before we can validate it. We have some default parsers but you can provide your own when necessary.

```ts
import { eventsExtensionPoint } from '@backstage/plugin-events-node/alpha';

// [...]

export const eventsModuleYourFeature = createBackendModule({
  pluginId: 'events',
  moduleId: 'your-feature',
  register(env) {
    // [...]
    env.registerInit({
      deps: {
        // [...]
        events: eventsExtensionPoint,
        // [...]
      },
      async init({ /* ... */ events /*, ... */ }) {
        // [...]
        events.addHttpPostBodyParser({
          contentType: 'application/x-www-form-urlencoded',
          parser: async (req, _topic) => {
            return {
              bodyParsed: req.body.toString('utf-8'),
              bodyBuffer: req.body,
              encoding: 'utf-8',
            };
          },
        });
      },
    });
  },
});
```

We have the following default parsers:

- `application/json`

---
_Source: https://npm.io/package/@backstage/plugin-events-backend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
