https://github.com/dev-thought/nestjs-github-webhooks
Connect your Github webhooks with NestJs - modern, fast, powerful node.js web framework
https://github.com/dev-thought/nestjs-github-webhooks
github-webhooks nestjs
Last synced: 8 months ago
JSON representation
Connect your Github webhooks with NestJs - modern, fast, powerful node.js web framework
- Host: GitHub
- URL: https://github.com/dev-thought/nestjs-github-webhooks
- Owner: Dev-Thought
- Created: 2019-12-09T19:49:58.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:55:13.000Z (almost 3 years ago)
- Last Synced: 2025-04-05T09:05:02.462Z (8 months ago)
- Topics: github-webhooks, nestjs
- Language: TypeScript
- Size: 1.41 MB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
## Description
[Github Webhooks](https://developer.github.com/webhooks/) module for [Nest](https://github.com/nestjs/nest).
## Installation
```bash
$ npm i --save @dev-thought/nestjs-github-webhooks
```
## Quick Start
### Import module
In `app.module.ts`:
```typescript
import { GithubWebhooksModule } from '@dev-thought/nestjs-github-webhooks';
@Module({
imports: [
...
GithubWebhooksModule.forRoot({
webhookSecret: 'YOUR_WEBHOOK_APIKEY'
}),
];
})
class AppModule {}
```
### Async import example
```typescript
@Module({
imports: [
...
GithubWebhooksModule.forRootAsync({
useFactory: () => ({ webhookSecret: 'SomeSecret' })
})
];
})
class AppModule {}
```
### Use the guard
```typescript
import {
GithubGuard,
GithubWebhookEvents,
} from '@dev-thought/nestjs-github-webhooks';
@Controller()
export class AppController {
@UseGuards(GithubGuard)
@Post()
githubWebhoook() {
...
}
@UseGuards(GithubGuard)
@GithubWebhookEvents(['push', 'pullrequest'])
@Post('withGithubEvent')
withRestrictedGithubEvents() {
...
}
}
```
## Tutorial
You can read more about this integration [here](https://medium.com/dev-thought/github-webhooks-with-nestjs-1e97c17418f6)
## 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](https://docs.nestjs.com/support).
## Stay in touch
- Author Github Webhooks Module for NestJS - [Mitko Tschimev](https://github.com/MitkoTschimev)
- Twitter Author - [Mitko Tschimev](https://twitter.com/MTschimev)
- Author NestJS - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website NestJS - [https://nestjs.com](https://nestjs.com/)
- Twitter NestJS - [@nestframework](https://twitter.com/nestframework)
## License
This Module is [MIT licensed](LICENSE).