Skip to content

Packages ​

relaybus is published as nine npm packages under the @relaybus scope, released together with one shared version.

PackagePurpose
@relaybus/coreThe bus, dispatcher, retry policies and the in-memory store.
@relaybus/nestjsRelayBusModule, the @RelayBusConsumer decorator, lifecycle and health.
@relaybus/postgresPostgreSQL 13+ store for pg, Kysely, Knex, TypeORM, Drizzle and Prisma transactions.
@relaybus/mongodbMongoDB 6+ store on multi-document transactions; works with Mongoose sessions.
@relaybus/kafkaKafka transport for @confluentinc/kafka-javascript (recommended) and kafkajs, CloudEvents binary mode.
@relaybus/rabbitmqRabbitMQ transport with publisher confirms, reconnects, quorum queues and dead letters.
@relaybus/testingThe store contract suite, a fake clock and an in-memory transport.
@relaybus/eslint-pluginESLint rules: no calls to other services inside a transaction, no publish outside one.
@relaybus/otelOpenTelemetry metrics, backlog gauges and one trace across services.

Typical installs ​

sh
# NestJS + PostgreSQL
pnpm add @relaybus/core @relaybus/nestjs @relaybus/postgres pg

# NestJS + MongoDB
pnpm add @relaybus/core @relaybus/nestjs @relaybus/mongodb mongodb

# add a broker
pnpm add @relaybus/kafka kafkajs
pnpm add @relaybus/rabbitmq amqplib

# tests and lint rules
pnpm add -D @relaybus/testing vitest
pnpm add -D @relaybus/eslint-plugin

# metrics and traces
pnpm add @relaybus/otel @opentelemetry/api

Bring your own store: implement the EventStore interface and run the contract suite from @relaybus/testing against it.

Released under the MIT License.