Documentation
Captcha

Captcha Integration

Adding Captcha to Your Form and Setting Up with Sheet2DB

Sheet2DB offers robust security features by allowing you to integrate Google Captcha and Turnstile Captcha into your forms. This guide will walk you through the steps to set up and configure Captcha for your forms using Sheet2DB.


Step 1: Choose Your Captcha Provider

Sheet2DB supports two types of Captchas:

  1. Google Captcha (reCAPTCHA)
  2. Cloudflare Turnstile Captcha

You need to choose one of these services based on your preference.


Step 2: Obtain Your Captcha Secret Key

To set up a Captcha, you will need a secret key from your chosen Captcha provider.

For Google reCAPTCHA:

  1. Go to Google reCAPTCHA Admin Console (opens in a new tab).
  2. Register your site and choose the type of reCAPTCHA you want to use (v2, v3, or Invisible).
  3. After registering, you will receive a Site Key and a Secret Key.

For Cloudflare Turnstile:

  1. Go to the Cloudflare Turnstile Dashboard (opens in a new tab).
  2. Register your site to get the Site Key and Secret Key.

Step 3: Configure Captcha in Sheet2DB

  1. Log in to your Sheet2DB Dashboard.
  2. Navigate to the Security section in the edit API page.
  3. In the Captcha dropdown, select the type of Captcha you want to use (Google Captcha or Turnstile).
  4. Enter the Secret Key that you obtained from your Captcha provider.
  5. Save the settings.

Step 4: Add Captcha to Your Form

Now that you've configured Captcha in Sheet2DB, you need to add the Captcha widget to your form.

For Google reCAPTCHA:

  1. Add the following code snippet to your form where you want the reCAPTCHA to appear:

    <div class="g-recaptcha" data-sitekey="YOUR_SITE_KEY"></div>
    <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  2. Replace YOUR_SITE_KEY with the Site Key provided by Google reCAPTCHA.

For Cloudflare Turnstile:

  1. Add the following code snippet to your form where you want the Turnstile Captcha to appear:

    <div class="cf-turnstile" data-sitekey="YOUR_SITE_KEY"></div>
    <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
  2. Replace YOUR_SITE_KEY with the Site Key provided by Cloudflare Turnstile.


Step 5: Verify Captcha Response

When a user submits the form, the Captcha response will be automatically verified by Sheet2DB before processing the submission. If the Captcha verification fails, the form submission will be rejected.


Troubleshooting

  • Captcha Not Displaying: Ensure that you've added the correct Site Key to your form and that the Captcha provider's JavaScript file is properly loaded.
  • Failed Verification: Double-check your Secret Key in the Sheet2DB dashboard and ensure that your site is properly registered with the Captcha provider.

By following these steps, you will successfully integrate and configure Captcha with your forms using Sheet2DB, ensuring enhanced security for your form submissions.