Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/halitsever/nest-cloudflare-turnstile

☁️ Cloudflare Turnstile Captcha integration for NestJS
https://github.com/halitsever/nest-cloudflare-turnstile

captcha cloudflare integration nest turnstile

Last synced: 6 days ago
JSON representation

☁️ Cloudflare Turnstile Captcha integration for NestJS

Awesome Lists containing this project

README

        



☁️ Cloudflare Turnstile integration for NestJS








Documentation



- 🧩 [**Simple and easy**](#) - This library provides just one guard to protect your endpoints with Cloudflare Turnstile Captcha!



Installation:

```bash
npm install nest-cloudflare-turnstile --save
```

add module to imports array:

```javascript

imports: [TurnstileModule.forRoot({
secretKey: '1x0000000000000000000000000000000AA',
tokenResponse: (req) => req.body.turnstileToken // or you can use req.headers.turnstileToken
})],

```

use `TurnstileCaptcha` decorator on controller:

```javascript

import { TurnstileCaptcha } from 'nest-cloudflare-turnstile'

@Post()
@TurnstileCaptcha()
getHello(): string {
return this.appService.getHello();
}
```

And thats it! For more information, please check the docs








MIT LICENSE | Halit Sever