nestjs-dapr
v1.0.3
Published
[Dapr](https://dapr.io) module for [NestJS](https://nestjs.com), fully compatible with any Dapr and NestJS version.
Downloads
10
Readme
Dapr Module for NestJS
Dapr module for NestJS, fully compatible with any Dapr and NestJS version.
Supported Dapr features:
- [ ] Pubsub API
- [x] Single Pubsub connection
- [ ] Multiple Pubsub connection
- [ ] Invocation API
- [ ] Binding API
- [ ] Configuration API
- [ ] Secret API
Installation
npm install nestjs-dapr
yarn add nestjs-dapr
pnpm add nestjs-dapr
Usage
Pubsub
export class AppController {
@Subscribe('topic')
handler(data: YourDefinedTopicData, fullPayload: DaprPubSubPayload) {
console.log(data)
}
}
export type DaprPubSubPayload = {
data: unknow // data that you publish to dapr
datacontenttype: string // default 'application/json'
id: string
pubsubname: string
source: string // app-id
specversion: string
time: string
topic: string
traceid: string
traceparent: string
tracestate: string
type: string
}