NestJS Integration
@synkro/nestjs brings Synkro into the NestJS ecosystem with decorator-based handler registration, async module configuration, and full feature parity with @synkro/core.
Features
- Decorator-based registration — use
@OnEventand@OnWorkflowStepto bind handlers directly on your service methods - Async module config — configure the transport and connection via
ConfigServiceor any async provider - Lazy provider binding — decorated handlers are discovered at startup and wired into the Synkro instance automatically
- Full core parity —
SynkroServiceexposespublish,on,introspect,getEventMetrics, and the rawgetInstanceescape hatch
Installation
npm install @synkro/nestjs @synkro/corePeer dependencies
| Package | Version |
|---|---|
@nestjs/common | ^10.0.0 || ^11.0.0 |
@nestjs/core | ^10.0.0 || ^11.0.0 |
@synkro/core | ^0.15.0 |
reflect-metadata | ^0.1.13 || ^0.2.0 |
Next steps
- Module Registration —
forRootandforRootAsyncconfiguration - Decorators —
@OnEventand@OnWorkflowStepusage - API Reference — full method and type reference