Skip to main content
The captcha plugin adds bot protection to any KavachOS endpoint. It validates a client-side token before the request is processed, blocking automated sign-ups and credential stuffing without extra middleware.

Supported providers

Setup

lib/kavach.ts

Client-side token

Add the provider’s widget to your form. When the user completes the challenge, include the token in the request body as captchaToken.
Sign up with captcha token (client)
The captchaToken field is stripped from the request before it reaches other plugins. Other plugin handlers never see it. Error codes

reCAPTCHA v3 score threshold

For reCAPTCHA v3, set a minimum score (0.0–1.0). Requests below the threshold are rejected:
lib/kavach.ts

Configuration reference

required
Captcha provider to use.
string
required
Server-side secret key from the provider dashboard.
string[]
default:"["
List of endpoint paths where captcha validation is enforced. Defaults to sign-up and sign-in.
number
Minimum score for reCAPTCHA v3. Ignored for other providers.
string
Request body field that contains the captcha token.
Last modified on April 17, 2026