[PR #5246] feat: add capjs captcha plugin #31480

Open
opened 2026-04-17 22:22:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5246
Author: @chris-windsor
Created: 10/12/2025
Status: 🔄 Open

Base: nextHead: feat/cap-captcha-plugin


📝 Commits (1)

  • b5dc758 feat: add capjs captcha plugin

📊 Changes

7 files changed (+126 additions, -2 deletions)

View changed files

📝 docs/content/docs/plugins/captcha.mdx (+3 -1)
📝 packages/better-auth/src/plugins/captcha/captcha.test.ts (+66 -0)
📝 packages/better-auth/src/plugins/captcha/constants.ts (+2 -0)
📝 packages/better-auth/src/plugins/captcha/index.ts (+4 -0)
📝 packages/better-auth/src/plugins/captcha/types.ts (+6 -1)
packages/better-auth/src/plugins/captcha/verify-handlers/cap.ts (+44 -0)
📝 packages/better-auth/src/plugins/captcha/verify-handlers/index.ts (+1 -0)

📄 Description

Add support for cap.js captcha plugin.

demo implementation repo

My only concern is what would be the preferred way to update typing so that siteVerifyURLOverride is required for this provider or make a new config option that is siteVerifyURL and ignore siteVerifyURLOverride.


Summary by cubic

Added Cap (cap.js) as a new captcha provider to the Better Auth captcha plugin with a server-side verify handler and docs updates.

  • New Features

    • New provider: "cap" with a verify handler that POSTs JSON { secret, response, remoteip }.
    • Wired provider into constants, types, and plugin selection; added tests for success, 403, and 500 flows.
    • Docs updated to list Cap and link to client integration guidance.
  • Migration

    • For provider "cap", set siteVerifyURLOverride to your Cap siteverify endpoint (no default URL is provided).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5246 **Author:** [@chris-windsor](https://github.com/chris-windsor) **Created:** 10/12/2025 **Status:** 🔄 Open **Base:** `next` ← **Head:** `feat/cap-captcha-plugin` --- ### 📝 Commits (1) - [`b5dc758`](https://github.com/better-auth/better-auth/commit/b5dc758c499ec71562fc5b052e70fd05a6c382f8) feat: add capjs captcha plugin ### 📊 Changes **7 files changed** (+126 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/captcha.mdx` (+3 -1) 📝 `packages/better-auth/src/plugins/captcha/captcha.test.ts` (+66 -0) 📝 `packages/better-auth/src/plugins/captcha/constants.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/captcha/index.ts` (+4 -0) 📝 `packages/better-auth/src/plugins/captcha/types.ts` (+6 -1) ➕ `packages/better-auth/src/plugins/captcha/verify-handlers/cap.ts` (+44 -0) 📝 `packages/better-auth/src/plugins/captcha/verify-handlers/index.ts` (+1 -0) </details> ### 📄 Description Add support for [cap.js](https://capjs.js.org/) captcha plugin. [demo implementation repo](https://github.com/chris-windsor/better-auth-capjs-demo) My only concern is what would be the preferred way to update typing so that `siteVerifyURLOverride` is required for this provider or make a new config option that is `siteVerifyURL` and ignore `siteVerifyURLOverride`. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added Cap (cap.js) as a new captcha provider to the Better Auth captcha plugin with a server-side verify handler and docs updates. - **New Features** - New provider: "cap" with a verify handler that POSTs JSON { secret, response, remoteip }. - Wired provider into constants, types, and plugin selection; added tests for success, 403, and 500 flows. - Docs updated to list Cap and link to client integration guidance. - **Migration** - For provider "cap", set siteVerifyURLOverride to your Cap siteverify endpoint (no default URL is provided). <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 22:22:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#31480