@azversan/mediasoup — A NestJS integration module for mediasoup (looking for feedback & contributors)

Hi everyone! :waving_hand:

I’ve been working on a NestJS integration module for mediasoup and just published the first stable release (v1.0.0). I’d love to get feedback from this community, especially around best practices, edge cases I might have missed, and ideas for further development.

What it does

@azversan/mediasoup wraps mediasoup’s core API (Workers, Routers, Transports, Producers, Consumers, Data Channels, RTP Observers) into a NestJS-friendly service layer, with:

  • Type-safe resource creation and retrieval (with generic overloads for transport/observer subtypes)
  • Round-robin worker load balancing for routers, with PID exclusion support
  • A centralized resource store backed by typed Maps
  • An ObserverService that bridges all native mediasoup worker/router/transport/producer/consumer/RTP-observer events into NestJS’s EventEmitter2, with a @OnMediasoup() decorator for easy subscription
  • Automatic resource usage telemetry (cascading counts from consumers/producers → router → worker)
  • Sync and async module registration (register / registerAsync) following standard NestJS conventions

Why I built this

I wanted a way to use mediasoup in NestJS apps without writing repetitive boilerplate for tracking entities and wiring up observer events every time. This module handles that plumbing so application code can focus on signaling/business logic.

Links

Looking for

  • General code review — especially around worker/router lifecycle management and the resource store design
  • Feedback on the event-bridging approach (any events I might be missing or handling incorrectly?)
  • Thoughts on the API surface — anything that feels awkward or could be more idiomatic
  • Anyone interested in contributing, especially around test coverage (currently quite minimal) and additional examples/docs

Open to any criticism, big or small. Thanks for taking a look! :folded_hands:

Great. I’ve added it to the mediasoup website under ontributor projects:

Anything related to mediasoup is always welcome, keep up the great work :sparkles:, and a special thanks to mediasoup maintainers! :heart: