🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

nestjs-slack-notifier

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-slack-notifier

Nest js package for slack notification

1.0.3
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

nestjs-slack-notifier

A simple nest js wrapper around the Slack webhook API. For sending notifications to slack from your nest js application.

Installation

npm install nestjs-slack-notifier
or
yarn add nestjs-slack-notifier

Usage

// Import module:

import { SlackNotificationModule } from 'nestjs-slack-notifier';
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [
    SlackNotificationModule.forRoot({
      // your slack webhook url goes here
      slackWebhookURL: 'xxxxxxxxx',
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
// Sending the notification using the serivce class

import { SlackNotificationService } from 'nestjs-slack-notifier';
import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
  constructor(
    private readonly slackNotificationService: SlackNotificationService,
  ) {}
  async sendMessage() {
    return this.slackNotificationService.success({
      text: 'Hey this is test',
    });
  }
}

//Pre-styled messages

await this.slackNotificationService.success({
    text: 'Hey this is success message',
});

await this.slackNotificationService.bug({
    text: 'Hey this is bug reported',
});

await this.slackNotificationService.error({
    text: 'Hey this is error message',
});

License

MIT. Copyright © 2022 Laxmikanta Nayak

Keywords

slack

FAQs

Package last updated on 12 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts