Spam protection
Protect against spam responses using Google reCAPTCHA.
Last updated
Was this helpful?
Protect against spam responses using Google reCAPTCHA.
Last updated
Was this helpful?
Use the built-in Google reCAPTCHA integration to protect against spam and fraudulent responses. To set up spam protection, use the recaptcha
and set your siteKey
during instantiation. (also known as a reCAPTCHA key). Once this is done, your forms will be protected.
recaptcha
optionThe recaptcha
option has the following parameters:
siteKey
string
Google reCAPTCHA site key.
action
string
The action name. Default is "submit"
.
badgePosition
"bottomleft"
| "bottomright"
| "inline"
The position of the reCAPTCHA badge. Default is "bottomleft"
.
hideBadge
boolean
Whether to hide the reCAPTCHA badge. Default is false
.
Set the hideBadge
parameter to true
to hide the reCAPTCHA badge.
Once Google reCAPTCHA has been set up, each form submission will contain an extra field called _captcha
. This is the token that needs to be verified by sending the following request:
URL: https://www.google.com/recaptcha/api/siteverify
Method: POST
secret
(required)
The shared key between your site and reCAPTCHA.
response
(required)
The user response token provided by the reCAPTCHA client-side integration on your site. This is the _captcha
token.
remoteip
Optional. The user's IP address.
The response is a JSON object:
You need to manually include links to Google's privacy policy and terms of service if you decide to hide the reCAPTCHA badge. .
Reference: