Configuring Google reCAPTCHA
Flux supports Google reCAPTCHA v2 to protect your forms from automated abuse. This integration handles the script injection and server-side validation automatically.
Step 1: Get Your Keys
Before configuring Flux, you need to register your site with Google.
- Go to the Google reCAPTCHA Admin Console.
- Click the + (Create) button.
- Label: Enter a descriptive name for your site (e.g., "Flux Forms").
- reCAPTCHA type:
- Select Challenge (v2).
- Choose either "I'm not a robot" Checkbox (recommended) or Invisible reCAPTCHA badge.
- Note: Flux is currently optimized for the v2 flow.
- Domains: Add the domain where your form will be hosted (e.g.,
mysite.com).- Tip: Add
localhostto this list if you are testing locally.
- Tip: Add
- Accept the Terms of Service and click Submit.
- Keep this tab open. You will need the Site Key and Secret Key for the next step.
Step 2: Configure Flux
Now, you need to store these credentials securely in your Flux instance.
- SSH into your Flux instance:
ssh -p 2222 admin@<your-ip> - Navigate to Infrastructure -> Captcha (or "Manage Captchas").
- Press
nto create a new configuration. - Provider Name: Give it a unique ID (e.g.,
google-main). - Type: Select
Google reCAPTCHAfrom the list. - Site Key: Paste the Site Key you copied from Google.
- Secret Key: Paste the Secret Key.
- Select Save (or press Enter) to confirm.
Step 3: Attach to a Form
Finally, you must tell Flux which form should use this protection.
- Go back to the Dashboard and select Forms (or "Manage Forms").
- Select the specific form you want to protect from the list.
- Select Edit Metadata.
- Scroll down to the Captcha dropdown field.
- Select your new provider (e.g.,
google-main). - Select Save & Exit.
That's it.
Flux will now automatically inject the required Google scripts and the widget into your form HTML. All future submissions for this form will be validated against Google's servers before being accepted.