Setting Up reCAPTCHA

Chapter 1:

Step 1: Sign Up for Google reCAPTCHA

  1. Register your site by adding your domain (e.g., localhost for development and your production domain).

  2. Choose reCAPTCHA v3.

  3. Copy the Site Key and Secret Key.

Step 2: Add Keys to Your Environment

  1. Open your .env file and add the keys:

RECAPTCHA_SITE_KEY=your_site_key
RECAPTCHA_SITE_SECRET=your_secret_key

Step 3 - Whitelisting Domains

In your backend, ensure that the domains allowed to submit forms are whitelisted. The SSK Form Component provides this by default for production and development environments.

const WHITE_LISTED_HOSTNAMES = [
  'localhost',
  'yourdomain.com',
  'www.yourdomain.com',
]

This prevents tokens from untrusted sources from being processed.

Last updated