Migration from Open-Source ALTCHA
This guide helps you migrate from self-hosted / open-source ALTCHA (Web Component or bundled widget + your verify route) to MTCaptcha when you want a managed script + CheckToken API instead of operating your own challenge backend.
Why migrate from open-source ALTCHA​
- Privacy and GDPR alignment: Reduce bespoke data flows through self-hosted verification endpoints; align with MTCaptcha’s documented privacy model. See Privacy GDPR Compliance.
- WCAG 2.1 AAA accessibility: Standardize on MTCaptcha’s accessibility posture and published materials. See Accessibility Compliance.
- Global reliability, including China: Replace self-managed regional routing with MTCaptcha’s delivery, including documented mainland China support. See Works in China.
Migration at a glance​
| Open-source ALTCHA | MTCaptcha | |
|---|---|---|
| Client script | Packaged ALTCHA client (e.g. altcha.min.js from your bundle) or ES module import | https://service.mtcaptcha.com/mtcv1/client/mtcaptcha.min.js |
| Widget class | Typically <altcha-widget> or framework wrapper you mount | .mtcaptcha (<div class="mtcaptcha"></div>) |
| Token name | Implementation-specific (often a custom field name in your form POST mirroring ALTCHA’s payload) | mtcaptcha-verifiedtoken |
| Backend API | Your server route that validates the ALTCHA payload (self-hosted) | GET https://service.mtcaptcha.com/mtcv1/api/checktoken (privatekey + token) |
Your MTCaptcha PrivateKey must stay on the server. The browser only receives the public SiteKey via mtcaptchaConfig.
Step 1: Replace client-side widget integration​
<!-- Remove [ALTCHA] — remove your <altcha-widget> / init code and ALTCHA script tags -->
<!-- Add [MTCaptcha] -->
<script>
var mtcaptchaConfig = { "sitekey": "YOUR_SITEKEY" };
</script>
<script src="https://service.mtcaptcha.com/mtcv1/client/mtcaptcha.min.js" async defer></script>
<div class="mtcaptcha"></div>
Initialize mtcaptchaConfig with "sitekey" before loading mtcaptcha.min.js.
Step 2: Replace server-side verification​
Remove calls to your ALTCHA verification handler and call MTCaptcha CheckToken instead:
GET https://service.mtcaptcha.com/mtcv1/api/checktoken?privatekey=YOUR_PRIVATEKEY&token=VERIFIED_TOKEN
Parse mtcaptcha-verifiedtoken from the request body (not your former ALTCHA field name).
Expect short TTLs and single-use semantics by default. See Validate Token (With Private Key).
Use https://service2.mtcaptcha.com/mtcv1/api/checktoken if you require fixed outbound IP allowlisting.
Troubleshooting​
| Symptom | What to check |
|---|---|
| Two widgets on screen | Remove leftover ALTCHA components before mounting MTCaptcha. |
| Old field still validated | Search codebase for prior ALTCHA field names and tests. |
| Verify route still hit | Delete unused ALTCHA routes to avoid false “success” paths. |
| CSP | Allow https://service.mtcaptcha.com (and service2 if used). |
Further reading​
Post-Migration Checklist​
- Removed ALTCHA client bundles, widgets, and server verification code.
-
mtcaptchaConfigwith"sitekey": "YOUR_SITEKEY"precedesmtcaptcha.min.js. - All forms POST
mtcaptcha-verifiedtokenand server useshttps://service.mtcaptcha.com/mtcv1/api/checktoken. - Monitoring/logging updated (no ALTCHA-specific errors).
- CSP/network paths validated.