Dapr module for NestJS, fully compatible with any Dapr and NestJS version.
- Pubsub API
- Single Pubsub connection
- Multiple Pubsub connection
- Invocation API
- Binding API
- Configuration API
- Secret API
npm install @nest-hero/dapr
yarn add @nest-hero/dapr
pnpm add @nest-hero/dapr
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
}