PHPackages                             c10d/craft-hcaptcha - 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. c10d/craft-hcaptcha

ActiveCraft-plugin

c10d/craft-hcaptcha
===================

Integrate hCaptcha validation into your forms.

3.0.1(2y ago)44.4k↓12.5%1MITPHPPHP ^8.2

Since May 1Pushed 2y ago2 watchersCompare

[ Source](https://github.com/c10d-dev/craft-hcaptcha)[ Packagist](https://packagist.org/packages/c10d/craft-hcaptcha)[ RSS](/packages/c10d-craft-hcaptcha/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (16)Used By (1)

hCAPTCHA plugin for Craft CMS
=============================

[](#hcaptcha-plugin-for-craft-cms)

Integrate hCAPTCHA validation into your forms.

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.4 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require c10d/craft-hcaptcha

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for craft-hcaptcha.

Configuring craft-hcaptcha
--------------------------

[](#configuring-craft-hcaptcha)

1. [Sign up for hCAPTCHA API key](https://dashboard.hcaptcha.com).
2. Open the Craft admin and go to Settings → Plugins → Craft hCAPTCHA → Settings.
3. Add your `site key` and `secret key`, then save.
4. Add the hCAPTCHA template tag and js to your forms.

Using craft-hcaptcha
--------------------

[](#using-craft-hcaptcha)

In your template, just add the following twig snippet to render the hCAPTCHA iframe:

```
{{ craft.hcaptcha.render() }}
```

Or you can change the id of the container, and set some options:

```
{{ craft.hcaptcha.render('hcap', { 'theme': 'dark' }) }}
```

If you're using a modal or for any reason the hcaptcha div is not in the DOM when the page is loaded, you could set a trigger when the block becomes visible (the js file should be already loaded):

```
{{ craft.hcaptcha.render('hcaptcha-1', { 'size': 'compact' }) }}

```

You can even create the block yourself and only get the site key variable:

```

```

If you want to know what options are available, see the [hCAPTCHA documentation](https://docs.hcaptcha.com/configuration).

NOTE: After this step is done, if you’re using the CraftCMS [Contact Form](https://plugins.craftcms.com/contact-form) plugin or you're using craft-hcaptcha to validate a public user registration, just activate the corresponding toggle in the plugin's settings, you're all set! (the hcaptcha will be automatically verified on submission)

Verify the hCAPTCHA
-------------------

[](#verify-the-hcaptcha)

On the server side, you can use this to verify that the hCAPTCHA was done:

```
use c10d\crafthcaptcha\CraftHcaptcha;

// [ ... ]

$captcha = Craft::$app->getRequest()->getParam('h-captcha-response');
$isValid = CraftHcaptcha::$plugin->hcaptcha->verify($captcha);
if (!$isValid) {
    // ERROR: you can push an error here
}
```

---

Brought to you by [Cédric Givord](https://c10d.dev)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity72

Established project with proven stability

 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 ~76 days

Recently: every ~104 days

Total

15

Last Release

777d ago

Major Versions

1.2.0 → 2.0.02022-06-02

v1.x-dev → 2.0.22023-02-11

2.2.0 → 3.0.02024-03-28

PHP version history (3 changes)1.0.0PHP ^7.2 || ^8.0

2.0.0PHP ^8.0.2

3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/795c5fc1a8528703df92033a1f823d92b2ff7b3f0edcecbe587643992aa3c85b?d=identicon)[c10d](/maintainers/c10d)

---

Top Contributors

[![c10d-dev](https://avatars.githubusercontent.com/u/83506623?v=4)](https://github.com/c10d-dev "c10d-dev (21 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginhcaptchacraft-hcaptcha

### Embed Badge

![Health badge](/badges/c10d-craft-hcaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/c10d-craft-hcaptcha/health.svg)](https://phpackages.com/packages/c10d-craft-hcaptcha)
```

###  Alternatives

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)

PHPackages © 2026

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