Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wemaintain/slack

Package Overview
Dependencies
Maintainers
14
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wemaintain/slack

Nest module for slack bots

  • 0.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
14
Created
Source

Nest Logo      Nest Logo

@wemaintain/slack

Slack module for Nest

Installation

  1. Install the required packages
    npm install --save @wemaintain/slack @slack/web-api @slack/events-api
  2. Import the SlackModule in your Module, ideally in the root module
@Module({
  imports: [
    SlackModule
  ],
  controllers: [],
  providers: [],
})
export class AppModule {}

Configuration

Configuration of the module can be acheived by using the forRoot and forRootAsync method

forRoot:

@Module({
  imports: [
    SlackModule.forRoot({
      signingSecret: process.env.SLACK_SIGNING_SECRET
    })
  ],
  controllers: [],
  providers: [],
})
export class AppModule {}

forRootAsync:

@Module({
  imports: [
    ConfigModule,
    SlackModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (option) => option.slack
    })
  ],
  controllers: [],
  providers: [],
})
export class AppModule {}

SlackClient: WebClient API

The SlackClient is a wrapper the WebClient Slack API Inject it inside your component like any other Provider:

  constructor(
    protected readonly slackService: SlackClient,
  ){}

SlackEvent: Event API

The SlackEventService is a service that listen for the Event Slack API

If the signingSecret is provided to the SlackModule it will look for @SlackEvent decorator in your controllers And bind them to the webhook listener

@Controller()
export class AppController {

  @SlackEvent('message')
  onMessageInChannel(): void {
    // Do thing
  }
}

FAQs

Package last updated on 20 Oct 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc