Search by

cripcha / cripcha-php

Crispy-Medias

Server side check of Cripcha tokens: the privacy-first, cookie-free captcha hosted in the EU

v1.0.3 2026-11-27 21:35 UTC

This package is auto-updated.

Last update: 2026-11-27 22:02:49 UTC


README

Server side check of Cripcha tokens. No dependency (curl, or PHP streams).

composer require cripcha/cripcha-php

(Or offline: download cripcha-php.zip from cripcha.crispy-medias.fr into artifacts/, then composer config repositories.cripcha artifact ./artifacts before the require.)

use Cripcha\Client;

$client = new Client($_ENV['CRIPCHA_SECRET']);           // cs_…, never in a template
$result = $client->verify($_POST[Client::TOKEN_FIELD] ?? '');
if (!$result->success) {
    // refuse the form; $result->errorCodes tells why
}

In the form: <div class="cripcha" data-sitekey="ck_…"></div> and the script of the widget.

  • Fails closed: an unreachable API or an unexpected answer refuses the form, without exception.
  • A token works once: verify it once per submission.
  • Your PSR-18 client: new Client($secret, transport: new Psr18Transport($client, $requestFactory, $streamFactory)).
  • Self-hosted or tests: new Client($secret, 'https://cripcha.example.internal/api/v1'), test secrets cs_test_always_pass / cs_test_always_fail.