[PR #7566] feat: Vercel BotID support on captcha plugin #7405

Open
opened 2026-03-13 13:35:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7566
Author: @davbrito
Created: 1/23/2026
Status: 🔄 Open

Base: canaryHead: feat/botid


📝 Commits (1)

  • db949a3 feat: Vercel BotID support on captcha plugin

📊 Changes

11 files changed (+194 additions, -4 deletions)

View changed files

📝 .cspell/third-party.txt (+1 -0)
📝 docs/content/docs/plugins/captcha.mdx (+23 -2)
📝 knip.jsonc (+4 -1)
📝 packages/better-auth/package.json (+5 -0)
📝 packages/better-auth/src/plugins/captcha/captcha.test.ts (+44 -0)
📝 packages/better-auth/src/plugins/captcha/constants.ts (+2 -0)
📝 packages/better-auth/src/plugins/captcha/index.ts (+10 -0)
📝 packages/better-auth/src/plugins/captcha/types.ts (+26 -1)
📝 packages/better-auth/src/plugins/captcha/verify-handlers/index.ts (+1 -0)
packages/better-auth/src/plugins/captcha/verify-handlers/vercel-botid.ts (+59 -0)
📝 pnpm-lock.yaml (+19 -0)

📄 Description

This pull request adds support for Vercel BotID as a new captcha provider in the Better Auth captcha plugin. It updates the documentation, types, and implementation to allow BotID to be used seamlessly alongside existing providers, and includes tests and dependency updates for the new provider.

Vercel BotID Integration:

  • Added Vercel BotID as a supported captcha provider in the plugin, including new provider constants and provider-specific options (validateRequest, checkBotIdOptions).
  • Implemented the BotID verification handler (vercelBotId) that uses the botid library for server-side bot detection, with customizable validation logic.
  • Updated tests to cover BotID scenarios, verifying both bot and human request handling.

Documentation Updates:

  • Extended the captcha plugin documentation to include setup and usage instructions for Vercel BotID, including installation steps, configuration notes, and client-side integration.

Dependency Management:

  • Added botid as an optional dependency in package.json and updated pnpm-lock.yaml accordingly.

Based on the work of @ping-maxwell at https://github.com/better-auth/better-auth/pull/3214

Resolves #7535, Closes #3214


Summary by cubic

Adds Vercel BotID as a captcha provider with server-side bot detection. No secret key or captcha token header needed; includes a new verify handler with customizable validation.

  • New Features
    • Added provider "vercel-botid" with a verify handler that runs before secret-key checks; default validation rejects requests when verification.isBot is true.
    • New options: validateRequest(ctx) and checkBotIdOptions; added VercelBotIdOptions and related types.
    • Updated docs with install/setup notes and examples; added tests for bot (403) vs human flows; added botid as an optional dependency/peer, plus knip and dictionary updates.

Written for commit db949a3081. Summary will update on new commits.


🔄 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/7566 **Author:** [@davbrito](https://github.com/davbrito) **Created:** 1/23/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `feat/botid` --- ### 📝 Commits (1) - [`db949a3`](https://github.com/better-auth/better-auth/commit/db949a3081cd9d9cf1f3019b08349d44791b0790) feat: Vercel BotID support on captcha plugin ### 📊 Changes **11 files changed** (+194 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.cspell/third-party.txt` (+1 -0) 📝 `docs/content/docs/plugins/captcha.mdx` (+23 -2) 📝 `knip.jsonc` (+4 -1) 📝 `packages/better-auth/package.json` (+5 -0) 📝 `packages/better-auth/src/plugins/captcha/captcha.test.ts` (+44 -0) 📝 `packages/better-auth/src/plugins/captcha/constants.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/captcha/index.ts` (+10 -0) 📝 `packages/better-auth/src/plugins/captcha/types.ts` (+26 -1) 📝 `packages/better-auth/src/plugins/captcha/verify-handlers/index.ts` (+1 -0) ➕ `packages/better-auth/src/plugins/captcha/verify-handlers/vercel-botid.ts` (+59 -0) 📝 `pnpm-lock.yaml` (+19 -0) </details> ### 📄 Description This pull request adds support for Vercel BotID as a new captcha provider in the Better Auth captcha plugin. It updates the documentation, types, and implementation to allow BotID to be used seamlessly alongside existing providers, and includes tests and dependency updates for the new provider. **Vercel BotID Integration:** - Added Vercel BotID as a supported captcha provider in the plugin, including new provider constants and provider-specific options (`validateRequest`, `checkBotIdOptions`). - Implemented the BotID verification handler (`vercelBotId`) that uses the `botid` library for server-side bot detection, with customizable validation logic. - Updated tests to cover BotID scenarios, verifying both bot and human request handling. **Documentation Updates:** - Extended the captcha plugin documentation to include setup and usage instructions for Vercel BotID, including installation steps, configuration notes, and client-side integration. **Dependency Management:** - Added `botid` as an optional dependency in `package.json` and updated `pnpm-lock.yaml` accordingly. Based on the work of @ping-maxwell at https://github.com/better-auth/better-auth/pull/3214 Resolves #7535, Closes #3214 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds Vercel BotID as a captcha provider with server-side bot detection. No secret key or captcha token header needed; includes a new verify handler with customizable validation. - **New Features** - Added provider "vercel-botid" with a verify handler that runs before secret-key checks; default validation rejects requests when verification.isBot is true. - New options: validateRequest(ctx) and checkBotIdOptions; added VercelBotIdOptions and related types. - Updated docs with install/setup notes and examples; added tests for bot (403) vs human flows; added botid as an optional dependency/peer, plus knip and dictionary updates. <sup>Written for commit db949a3081cd9d9cf1f3019b08349d44791b0790. Summary will update on new commits.</sup> <!-- 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-03-13 13:35:09 -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#7405