@nest-hero/dapr
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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
}

Readme

Keywords

Package Sidebar

Install

npm i @nest-hero/dapr

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

10.6 kB

Total Files

20

Last publish

Collaborators

  • duyld