@dev-thought/nestjs-github-webhooks
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective

Description

Github Webhooks module for Nest.

Installation

$ npm i --save @dev-thought/nestjs-github-webhooks

Quick Start

Import module

@Module({
  imports: [
    ...
    GithubWebhooksModule.forRoot({
      webhookSecret: 'YOUR_WEBHOOK_APIKEY'
    }),
  ];
})
class AppModule {}

Async import example

@Module({
  imports: [
    ...
    GithubWebhooksModule.forRootAsync({
      useFactory: () => ({ webhookSecret: 'SomeSecret' })
    })
  ];
})
class AppModule {}

Use the guard

@Controller()
export class AppController {

  @UseGuards(GithubGuard)
  @Post()
  githubWebhoook() {
    ...
  }

  @UseGuards(GithubGuard)
  @GithubWebhookEvents(['push', 'pullrequest'])
  @Post('withGithubEvent')
  withRestrictedGithubEvents() {
    ...
  }
}

Tutorial

You can read more about this integration coming soon

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

This Module is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @dev-thought/nestjs-github-webhooks

Weekly Downloads

565

Version

1.0.0

License

MIT

Unpacked Size

29.3 kB

Total Files

21

Last publish

Collaborators

  • tfiwm