Aller au contenu

Ce contenu n’est pas encore disponible dans votre langue.

Migrating from hCaptcha

This guide walks you through migrating from hCaptcha to ALTCHA Sentinel, a lightweight and privacy-respecting alternative designed for modern web apps.

Key Differences

FeaturehCaptchaALTCHA
Challenge TypeVisual puzzles, user interactionFrictionless or code challenge
ImplementationThird-party hostedSelf-hosted
AccessibilityCan present barriers to usersWCAG compliant, screen-reader friendly
PrivacyShares data with external providersNo tracking, privacy-focused
ComplianceRequires vendor evaluationGDPR, CCPA, HIPAA, CPPA, LGPD, DPDPA, PIPL compliant
VerificationServer-to-hCaptcha API callFast, local cryptographic verification
Limit< 100,000 / monthUnlimited

Implementation Comparison

hCaptcha (Previous Implementation)

Frontend:

<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
<div class="h-captcha" data-sitekey="YOUR_SITE_KEY"></div>

Backend (Node.js example):

const response = req.body["h-captcha-response"];
const secret = "YOUR_SECRET_KEY";
const resp = await fetch("https://hcaptcha.com/siteverify", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
secret,
response,
}),
});
const verification = await resp.json();
if (!verification.success) {
throw new Error("hCaptcha verification failed");
}

ALTCHA Sentinel (New Implementation)

Frontend:

Install the altcha package or include it directly in your app:

import "altcha";

Then use the widget in your form:

<altcha-widget
challengeurl="https://sentinel.example.com/v1/challenge?apiKey={YOUR_API_KEY}"
></altcha-widget>

Backend (Node.js example):

For supported environments, see Libraries and Plugins. Currently supported environments include TypeScript, Go, Python, Java, Elixir, PHP, and Ruby.

If the library is not available in your environment, you can use the POST /v1/verify/signature endpoint to verify the payload.

verify.js
import { verifyServerSignature } from "altcha-lib";
// The Base64-encoded payload received from the Widget upon submission
const payload = req.body["altcha"];
// Use the secret from your Sentinel App for the API key used in the challenge
const apiKeySecret = "sec_...";
// Verify the payload
const { verified } = await verifyServerSignature(payload, apiKeySecret);
if (!verified) {
throw new Error("ALTCHA verification failed");
}

For more details, refer to the Server Integration guide.

Migration Steps

  1. Remove hCaptcha dependencies

    • Remove the hCaptcha script and widget HTML
    • Delete any hCaptcha verification logic from your backend
  2. Install ALTCHA

  3. Add server-side verification

Benefits of Migration

  • No need for third-party services
  • Faster, more accessible user experience
  • Transparent, auditable, and self-hosted solution
  • No user tracking, improving privacy posture

Troubleshooting

Having issues with integration? Visit the Troubleshooting guide.

Further Reading