Start with the actual migration surface#
A reCAPTCHA migration can touch every public form, login, account-recovery flow, checkout, and API action that accepts a token. The migration to hCaptcha is contained when those flows already use the standard client widget and server-side verification pattern. hCaptcha documents API compatibility with reCAPTCHA callbacks and tag attributes, so existing callbacks and attributes can stay in place while the provider-specific script, class, keys, form field, and verification endpoint change.
Make an inventory before changing code. Record each site or app, sitekey, hostname, protected action, client component, server verification handler, score threshold, Content Security Policy, analytics event, and support instruction. Include integrations managed through a CMS, plugin, mobile SDK, tag manager, or shared design system. This is how a team finds the password-reset form or regional storefront that a source-code search misses.
What changes when you switch to hCaptcha#
hCaptcha's switching guide gives the core implementation steps. A typical standard integration keeps its surrounding application flow and updates the provider-specific pieces below.
| Migration area | hCaptcha change | Check before release |
|---|---|---|
| Keys | Create an hCaptcha sitekey and secret in the dashboard | Use separate keys for each environment and confirm permitted hostnames |
| Client script | Load hCaptcha's JavaScript API | Update Content Security Policy to permit the hCaptcha domains the Developer Guide specifies |
| Widget | Change g-recaptcha to h-captcha and supply the new sitekey |
Confirm the widget loads, localization works, and callbacks still fire |
| Form response | Read h-captcha-response |
Confirm the token reaches the server for every protected form and programmatic flow |
| Backend | Send the token and hCaptcha secret to https://api.hcaptcha.com/siteverify |
Use a form-encoded POST, check success, log error codes, and reject failed verification |
The documented compatibility is especially useful for mature applications with callbacks, theme settings, sizes, and explicit rendering already in place. The configuration guide also documents a grecaptcha compatibility hook, which can reduce changes in client code that calls supported programmatic methods.
Treat score migrations as a separate security review#
Teams that only verify a token can follow the standard migration path. An Enterprise application that uses scores needs one extra review: hCaptcha Enterprise scores are risk scores. A score of 0.0 indicates no risk, while 1.0 indicates a confirmed threat. Existing score checks must invert before release.
List each allow, verify, limit, and block rule with its old condition and intended hCaptcha outcome. Test the boundary on both sides of every threshold. This protects against a quiet policy reversal that allows high-risk traffic or interrupts normal customers.
Migration is also a chance to decide where risk should be assessed. hCaptcha Enterprise can extend the deployment beyond one widget with bot detection, account and transaction protection, rules, and real-time risk signals. Bot Detection can support the same evaluation across login, signup, checkout, and API actions. Start with the current protected routes; add journey coverage after the base integration is producing sound results.
Roll out one journey at a time#
Choose a representative but bounded first release, such as a contact form or one login surface. Put the new sitekey, secret, CSP, server endpoint, monitoring, and support copy through the normal change process. Keep the old provider configuration available for rollback until the new path meets the agreed success and security criteria.
Move next to higher-value journeys only after the first release proves its behavior. Login and account recovery need attention to rate limits, session state, error messages, and user support. Checkout needs a review of order creation and payment authorization sequencing. API integrations need token handling that cannot be bypassed by calling a backend route directly.
For an invisible flow, confirm that the trigger, success callback, error callback, expiry callback, and visible-challenge path all work from the real action. The application should never accept the protected request until its backend has verified the hCaptcha token.
Test success, rejection, and failure paths#
Use a test environment with hCaptcha's documented test keys for routine integration tests. Those keys provide no production bot protection, so keep them out of production configuration.
Test the paths that a release can break:
- A valid token accepts the intended action.
- A missing, invalid, expired, or previously used token is rejected by the server.
- A client-side error gives the visitor a clear retry path.
- A forced challenge displays correctly and the completed token reaches the backend.
- CSP, consent tooling, localization, accessibility tooling, and browser extensions do not prevent a supported flow from completing.
- The rollback procedure restores the known configuration without leaving a route unprotected.
The Developer Guide lists test keys for standard and Enterprise scenarios, an invalid-token test approach, and a way to force a visual challenge. Run those checks in the same browsers, networks, and form states that production users will encounter.
Define a fallback that keeps the action safe#
A fallback is a product decision, not just an error page. For a low-value contact form, the fallback might ask the visitor to retry later. A password reset, payout change, or account-recovery request may need a verified support route, a temporary hold, or another controlled verification step.
Do not let a client loading error turn into automatic acceptance of a sensitive request. Define who owns the decision, what the visitor sees, how long the fallback lasts, and what evidence the team records. The hCaptcha configuration guide documents error and expired callbacks; connect them to an application response that fits the risk of the action.
Monitor the migration after launch#
Watch both the integration and the protected outcome. Track client-load errors, token creation, siteverify failures by error code, challenge rate, completion rate, form completion, login success, abuse attempts, confirmed abuse, and support contacts. Break results out by journey, browser, region, and release version.
Review the first days of production traffic with the security and product teams. A falling error rate does not prove the policy is correct if fraud or automated traffic rises. A low challenge rate does not explain a failed form. hCaptcha's Enterprise controls and risk data give teams a basis to adjust response rules when the evidence from a journey changes.
Frequently asked questions#
Is hCaptcha compatible with reCAPTCHA integrations?
hCaptcha documents API compatibility with reCAPTCHA callbacks and tag attributes. A standard migration updates the client script, widget class, sitekey, form response field, secret, and server-side siteverify endpoint.
What changes in a reCAPTCHA v3 or Enterprise score migration?
hCaptcha Enterprise uses risk scores: 0.0 means no risk and 1.0 means a confirmed threat. Invert every score condition and test the resulting allow, verify, limit, and block behavior before production.
How should a team test an hCaptcha migration?
Use hCaptcha test keys in a non-production environment, then test valid, invalid, expired, and repeated tokens; client errors; visible challenges; callbacks; CSP; accessibility; and rollback. Test each protected journey, including the application flow around the widget.
What is a safe CAPTCHA fallback?
Match the fallback to the action's risk. Provide a retry or controlled support route, and keep backend verification in place. A client-side failure should not automatically let a sensitive request proceed.
Can hCaptcha do more than replace a CAPTCHA widget?
Yes. hCaptcha Enterprise can apply bot detection, risk scoring, account and transaction protection, rules, and adaptive verification across high-value user actions. Begin with the migration target, then expand the integration based on the attack patterns and policies that matter to the organization.
Sources and references
- Switch from reCAPTCHA to hCaptcha hCaptcha Docs
- Developer Guide hCaptcha Docs
- Configuration hCaptcha Docs
- Enterprise Overview hCaptcha Docs
- Enterprise hCaptcha
- Bot Detection hCaptcha