> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: $w ## Namespace: captcha ## Article: Introduction ## Article Link: https://dev.wix.com/docs/velo/velo-only-apis/$w/captcha/introduction.md ## Article Content: # Introduction The [reCAPTCHA](https://support.wix.com/en/article/about-recaptcha) element helps protect your site from spam and automated abuse. Visitors must complete a challenge, like clicking a box or identifying objects in images, to prove they are human before performing actions like submitting data, logging in, or accessing private content.
Important: To ensure complete protection, you must include [backend authorization](https://dev.wix.com/docs/velo/api-reference/wix-captcha-backend/authorize.md) as a mandatory step of the CAPTCHA validation lifecycle outlined below.### Typical CAPTCHA Validation Lifecycle The following outlines the typical lifecycle for CAPTCHA validation: 1. A button or another clickable element that triggers a submit, login, or another restricted operation is disabled, pending CAPTCHA verification. 1. A site visitor completes the CAPTCHA challenge. One of the following occurs: * Verification: The CAPTCHA is verified. A [`token`](https://dev.wix.com/docs/velo/api-reference/$w/captcha/token.md) is generated. The [`onVerified()`](https://dev.wix.com/docs/velo/api-reference/$w/captcha/on-verified.md) event confirms successful completion of the CAPTCHA challenge. Use this event handler to enable the previously disabled clickable element. * Error: The reCAPTCHA element loses connection with the CAPTCHA provider. You can use the [`onError()`](https://dev.wix.com/docs/velo/api-reference/$w/captcha/on-error.md) event handler to instruct the visitor to try again later. Return to Step 1. 1. The clickable element is enabled. One of the following occurs: * Click: The site visitor clicks the clickable element, triggering a backend function that calls [`authorize()`](https://dev.wix.com/docs/velo/api-reference/wix-captcha-backend/authorize.md) with the generated token from the previous step to check whether the token is valid (authorized). * Timeout: The site visitor didn't click the submit button within 120 seconds of token generation, causing the token to expire. When timeout occurs, the reCAPTCHA element automatically resets and displays a message asking the site visitor to redo the challenge. Use the [`onTimeout()`](https://dev.wix.com/docs/velo/api-reference/$w/captcha/on-timeout.md) event handler to disable the clickable trigger. Return to Step 1. 1. In the token authorization process, one of the following occurs: * Authorization: The CAPTCHA token is authorized. Perform the restricted operation (such as data insert) in the backend function. Call [`reset()`](https://dev.wix.com/docs/velo/api-reference/$w/captcha/reset.md) to reset the reCAPTCHA element for future operations. * Error: Token fails authorization. Call [`reset()`](https://dev.wix.com/docs/velo/api-reference/$w/captcha/reset.md) to reset the reCAPTCHA element and ask the visitor to redo the challenge. Return to Step 1. > **Notes:** > + To use CAPTCHA for data submission via a dataset, you must implement the submission using code. For example, use Wix Data APIs like [insert()](https://dev.wix.com/docs/velo/api-reference/wix-data/insert.md) or [save()](https://dev.wix.com/docs/velo/api-reference/wix-data/save.md) to handle the data operation and integrate CAPTCHA for protection. > + You can add reCAPTCHA to [Wix Forms](https://support.wix.com/en/article/wix-forms-protecting-your-site-forms-from-spam-with-a-captcha-field) and [Signup & Login Settings](https://support.wix.com/en/article/site-members-editing-the-signup-settings-for-the-default-and-custom-forms) for site members without code. [Learn more about working with your reCAPTCHA element](https://support.wix.com/en/article/velo-tutorial-using-recaptcha-to-protect-data-submission).