@anchan828/nest-sendgrid-terminus

A terminus of @sendgrid/mail module for Nest framework (node.js)

Usage no npm install needed!

<script type="module">
  import anchan828NestSendgridTerminus from 'https://cdn.skypack.dev/@anchan828/nest-sendgrid-terminus';
</script>

README

@anchan828/nest-sendgrid-terminus

Description

The terminus of @sendgrid/mail module for Nest.

Installation

$ npm i --save @anchan828/nest-sendgrid-terminus @nestjs/terminus

Quick Start

@Module({
  imports: [TerminusModule, SendGridHealthModule],
})
export class HealthModule {}

@Controller("health")
export class HealthController {
  constructor(private health: HealthCheckService, private sendgrid: SendGridHealthIndicator) {}

  @Get()
  @HealthCheck()
  readiness() {
    return this.health.check([async () => this.sendgrid.isHealthy()]);
  }
}

/health response

{
  "status": "ok",
  "info": {
    "sendgrid": {
      "status": "up",
      "apiStatus": "operational"
    }
  },
  "error": {},
  "details": {
    "sendgrid": {
      "status": "up",
      "apiStatus": "operational"
    }
  }
}

License

MIT