PHPackages                             captcha-eu/drupal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. captcha-eu/drupal

ActiveDrupal-module[Security](/categories/security)

captcha-eu/drupal
=================

Integrate captcha.eu protection service to prevent spam and abuse while ensuring smooth user experience.

v1.1.0(10mo ago)236GPL-2.0+JavaScript

Since Jul 5Pushed 5mo agoCompare

[ Source](https://github.com/captcha-eu/drupal)[ Packagist](https://packagist.org/packages/captcha-eu/drupal)[ Docs](https://github.com/captcha-eu/drupal)[ RSS](/packages/captcha-eu-drupal/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Captcha.EU Drupal Extension
===========================

[](#captchaeu-drupal-extension)

[![Drupal Version](https://camo.githubusercontent.com/fc60023bfa73203c0c97fbb283bfc0413fe9a542658d55dfb5dde6d19ab5cb7e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44727570616c2d382e39253242253230253743253230392e7825323025374325323031302e7825323025374325323031312e782d626c7565)](https://camo.githubusercontent.com/fc60023bfa73203c0c97fbb283bfc0413fe9a542658d55dfb5dde6d19ab5cb7e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44727570616c2d382e39253242253230253743253230392e7825323025374325323031302e7825323025374325323031312e782d626c7565)[![License](https://camo.githubusercontent.com/4aae2c3655ea8953226e8c945f3655e5b02530653682983e51dff6dbb759555e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c2d2d322e302532422d677265656e)](https://camo.githubusercontent.com/4aae2c3655ea8953226e8c945f3655e5b02530653682983e51dff6dbb759555e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c2d2d322e302532422d677265656e)[![Status](https://camo.githubusercontent.com/9e968d9471725151bf93b46bcd079913754b36f39f5205ac6b0c1e18328adb7b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d537461626c652d627269676874677265656e)](https://camo.githubusercontent.com/9e968d9471725151bf93b46bcd079913754b36f39f5205ac6b0c1e18328adb7b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d537461626c652d627269676874677265656e)

A comprehensive Drupal module that integrates [Captcha.EU](https://captcha.eu/) anti-bot protection service into your Drupal forms. Provides seamless spam protection without compromising user experience.

✨ Features
----------

[](#-features)

- 🔒 **Dual Operation Modes**:
    - **Invisible Mode**: Seamless protection without visible captcha (default)
    - **Widget Mode**: Visible "I am human" button for enhanced user awareness
- ⚙️ **Easy Configuration**: Intuitive admin interface for API keys and settings
- 🎨 **Theme Support**: Light, dark, clean, and auto themes for widget mode
- 🌐 **Universal Compatibility**: Works with contact forms, user registration, search forms, and custom forms
- 💡 **Clean UI**: Automatically removes Drupal's default CAPTCHA styling
- 📊 **Enhanced Logging**: Detailed validation logging for debugging
- 🚀 **High Performance**: Handles long captcha tokens (3000+ characters)
- 🔄 **Multiple Forms**: Supports multiple captcha instances per page with unique IDs

📋 Requirements
--------------

[](#-requirements)

- **Drupal**: 8.9+ / 9.x / 10.x / 11.x
- **Dependencies**: [CAPTCHA module](https://www.drupal.org/project/captcha)
- **Account**: Captcha.EU account with API keys ([Sign up here](https://captcha.eu/signup))

🚀 Installation
--------------

[](#-installation)

### Method 1: Download from GitHub (Recommended)

[](#method-1-download-from-github-recommended)

1. **Download the module**:

    ```
    cd /path/to/your/drupal/web/modules/custom/
    git clone https://github.com/captcha-eu/drupal.git captchaeu
    ```
2. **Install dependencies**:

    ```
    # Install CAPTCHA module if not already installed
    composer require drupal/captcha
    ```
3. **Enable the modules**:

    ```
    drush en captcha captchaeu -y
    ```

### Method 2: Manual Installation

[](#method-2-manual-installation)

1. **Download and extract**:

    - Download ZIP from [GitHub releases](https://github.com/captcha-eu/drupal/releases)
    - Extract to `/web/modules/custom/captchaeu/`
2. **Enable via Drupal UI**:

    - Go to `Extend` → Enable `CAPTCHA` and `Captcha.EU` modules

### Method 3: Using DDEV (Development)

[](#method-3-using-ddev-development)

```
# Clone and set up development environment
git clone https://github.com/captcha-eu/drupal.git captcha-eu-drupal
cd your-drupal-project
ln -s /path/to/captcha-eu-drupal web/modules/custom/captchaeu
ddev drush en captcha captchaeu -y
```

Configuration
-------------

[](#configuration)

1. **Get your API keys**:

    - Register at
    - Get your **Public Key** and **REST Key** from the dashboard
2. **Configure the module**:

    - Go to `Configuration → People → CAPTCHA → Captcha.EU`
    - Enter your **Public Key** and **REST Key**
    - Choose your preferred **Widget Mode** and **Theme**
    - Save configuration
3. **Set up CAPTCHA points**:

    - Go to `Configuration → People → CAPTCHA`
    - Click **Add CAPTCHA point**
    - Select form (e.g., `contact_message_feedback_form`, `user_register_form`)
    - Choose **Captcha.EU** as challenge type
    - Save

Widget Modes
------------

[](#widget-modes)

### Invisible Mode (Default)

[](#invisible-mode-default)

- **No visible captcha widget**
- **Seamless user experience**
- **Automatic solution generation** on form submission
- **Perfect for contact forms** and general use

### Widget Mode

[](#widget-mode)

- **Visible "I am human" button**
- **Clear user indication** of protection
- **Multiple theme options** (light, dark, clean, auto)
- **Optional auto-run** on page load

Usage Examples
--------------

[](#usage-examples)

### Contact Forms

[](#contact-forms)

```
# Add to contact form
Form ID: contact_message_feedback_form
Challenge type: Captcha.EU
```

### User Registration

[](#user-registration)

```
# Add to user registration
Form ID: user_register_form
Challenge type: Captcha.EU
```

### Custom Forms

[](#custom-forms)

Works with any Drupal form by adding the appropriate form ID as a CAPTCHA point.

API Integration
---------------

[](#api-integration)

The module integrates with Captcha.EU's API:

- **Client-side**: Loads SDK from `https://www.captcha.eu/sdk.js`
- **Server-side**: Validates solutions via `https://www.captcha.eu/validate`
- **Secure**: Uses REST-Key authentication for server validation

Troubleshooting
---------------

[](#troubleshooting)

### Widget Not Showing

[](#widget-not-showing)

1. Check that you have valid Public Key and REST Key
2. Verify CAPTCHA point is configured for your form
3. Check browser console for JavaScript errors
4. Ensure the Captcha.EU SDK is loading

### Form Submission Issues

[](#form-submission-issues)

1. Enable logging in Captcha.EU settings
2. Check Drupal logs at `Reports → Recent log messages`
3. Verify your REST Key is correct
4. Check for JavaScript errors in browser console

### Styling Issues

[](#styling-issues)

- The module automatically hides Drupal's default CAPTCHA styling
- Custom themes may need additional CSS adjustments

Development
-----------

[](#development)

### File Structure

[](#file-structure)

```
captchaeu/
├── captchaeu.info.yml           # Module definition
├── captchaeu.module             # Main module logic
├── captchaeu.libraries.yml      # Asset definitions
├── captchaeu.routing.yml        # Route definitions
├── src/Form/                    # Admin configuration form
├── js/captchaeu.setup.js        # JavaScript integration
├── css/captchaeu.css            # Styling overrides
└── config/                      # Configuration schema and defaults

```

### JavaScript Events

[](#javascript-events)

The module handles these events:

- `CPT_OK`: Captcha solved successfully
- `CPT_FAILED`: Captcha validation failed
- `CPT_EXPIRED`: Captcha solution expired

Credits
-------

[](#credits)

This module is based on the excellent [FriendlyCaptcha Drupal module](https://git.drupalcode.org/project/friendlycaptcha) and adapted for Captcha.EU service.

**Original FriendlyCaptcha module**:

License
-------

[](#license)

GPL-2.0+

Support
-------

[](#support)

- **Documentation**:
- **Captcha.EU Support**:
- **Issues**: [GitHub Issues](https://github.com/captcha-eu/drupal/issues)

Changelog
---------

[](#changelog)

### 1.0.0

[](#100)

- Initial release
- Invisible and widget modes
- Full Drupal 8.9+ compatibility
- Clean UI without default CAPTCHA styling
- Comprehensive admin configuration

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance63

Regular maintenance activity

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

317d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/332619bd04fc4a9dc8850acd4ae574fd6f1b001ef81c67fd9879fd03459f510b?d=identicon)[hjanuschka](/maintainers/hjanuschka)

---

Top Contributors

[![hjanuschka](https://avatars.githubusercontent.com/u/2891702?v=4)](https://github.com/hjanuschka "hjanuschka (12 commits)")

### Embed Badge

![Health badge](/badges/captcha-eu-drupal/health.svg)

```
[![Health](https://phpackages.com/badges/captcha-eu-drupal/health.svg)](https://phpackages.com/packages/captcha-eu-drupal)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41478.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

87117.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[paragonie/hidden-string

Encapsulate strings in an object to hide them from stack traces

7410.6M39](/packages/paragonie-hidden-string)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
