{"id":14978606,"url":"https://github.com/halitsever/nest-cloudflare-turnstile","last_synced_at":"2025-04-08T03:08:53.047Z","repository":{"id":254926102,"uuid":"847979978","full_name":"halitsever/nest-cloudflare-turnstile","owner":"halitsever","description":"☁️ Cloudflare Turnstile Captcha integration for NestJS","archived":false,"fork":false,"pushed_at":"2024-10-16T14:27:09.000Z","size":768,"stargazers_count":57,"open_issues_count":3,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T21:45:29.259Z","etag":null,"topics":["captcha","cloudflare","integration","nest","turnstile"],"latest_commit_sha":null,"homepage":"https://halitsever.github.io/nest-cloudflare-turnstile","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halitsever.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-26T23:03:09.000Z","updated_at":"2025-04-03T13:19:30.000Z","dependencies_parsed_at":"2024-08-27T02:08:58.738Z","dependency_job_id":"0688dafa-2987-42e5-9b2a-8c5f9109a078","html_url":"https://github.com/halitsever/nest-cloudflare-turnstile","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"9a6e421e212195d0da8ed01858d92b4ec8847718"},"previous_names":["halitsever/nest-cloudflare-turnstile"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halitsever%2Fnest-cloudflare-turnstile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halitsever%2Fnest-cloudflare-turnstile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halitsever%2Fnest-cloudflare-turnstile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halitsever%2Fnest-cloudflare-turnstile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halitsever","download_url":"https://codeload.github.com/halitsever/nest-cloudflare-turnstile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767234,"owners_count":20992547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","cloudflare","integration","nest","turnstile"],"created_at":"2024-09-24T13:58:01.240Z","updated_at":"2025-04-08T03:08:52.996Z","avatar_url":"https://github.com/halitsever.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" class=\"logo-section\"\u003e\n\u003cimg src=\"https://i.ibb.co/HT1M4Kb/image.png\" height=\"80\" width=\"80\"/\u003e\n\u003c/br\u003e\n\u003cimg src=\"https://halitsever-api.vercel.app/api/repo-title?title=Cloudflare%20Turnstile%20NestJS\"\u003e\n\n\u003cp align=\"center\"\u003e\n☁️ Cloudflare Turnstile integration for NestJS\u003cbr\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cimg src=\"https://img.shields.io/github/sponsors/halitsever\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca align=\"center\" href=\"https://halitsever.github.io/nest-cloudflare-turnstile\"\u003eDocumentation\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://halitsever-api.vercel.app/api/details\"/\u003e\n\u003c/p\u003e\n\n- 🧩 [**Simple and easy**](#) - This library provides just one guard to protect your endpoints with Cloudflare Turnstile Captcha!\n\n\u003cp align=\"center\" \u003e\n\u003cimg src=\"https://halitsever-api.vercel.app/api/installation\"/\u003e\n\u003c/p\u003e\n\nInstallation:\n\n```bash\nnpm install nest-cloudflare-turnstile --save\n```\n\nadd module to imports array with forRoot method:\n\n```javascript\n\n  imports: [TurnstileModule.forRoot({\n    secretKey: '1x0000000000000000000000000000000AA',\n    tokenResponse: (req) =\u003e req.body.turnstileToken // or you can use req.headers.turnstileToken\n  })],\n\n```\n\nor with forRootAsync method:\n\n```javascript\n imports: [\n    TurnstileModule.forRootAsync({\n      imports: [ConfigModule],\n      inject: [ConfigService],\n      useFactory: (config: ConfigService) =\u003e {\n        const secretKey = config.get\u003cstring\u003e(\n          'CLOUDFLARE_TURNSTILE_PRIVATE_KEY',\n        );\n        if (!secretKey) {\n          throw new Error('Missing Cloudflare Turnstile secret');\n        }\n\n        return {\n          secretKey,\n          tokenResponse: (req) =\u003e req.body.turnstileToken,\n        };\n      },\n    }),\n  ]\n```\n\nuse `TurnstileCaptcha` decorator on controller:\n\n```javascript\n\n  import { TurnstileCaptcha } from 'nest-cloudflare-turnstile'\n\n  @Post()\n  @TurnstileCaptcha()\n  getHello(): string {\n    return this.appService.getHello();\n  }\n```\n\nAnd thats it! For more information, please check the \u003ca href=\"https://halitsever.github.io/nest-cloudflare-turnstile\"\u003edocs\u003c/a\u003e\n\n\u003cp align=\"center\" href=\"https://github.com/halitsever/repo_name/issues\"\u003e\n\u003cimg src=\"https://halitsever-api.vercel.app/api/issue\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://halitsever-api.vercel.app/api/sponsor\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://halitsever-api.vercel.app/api/license\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  MIT LICENSE | \u003ca href=\"https://halit.org\"\u003eHalit Sever\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalitsever%2Fnest-cloudflare-turnstile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalitsever%2Fnest-cloudflare-turnstile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalitsever%2Fnest-cloudflare-turnstile/lists"}