A lightweight TypeScript library for integrating custom captcha challenges into web applications. This library provides a communication bridge between your challenge implementation and the captcha widget system.
Add dependency in package.json
"dependencies": {
"@gotcha-widget/lib": "github:tcerqueira/gotcha-widget-lib#master"
}
The library exposes several functions and types to handle captcha challenge responses and events.
The challenge implementation can be hosted anywhere only. The challenge is defined as a URL, width and height.
The Gotcha implementation will render your challenge inside an iframe
by your given URL.
import { onChallengeResponse, onChallengeExpired, onChallengeError } from '@gotcha-widget/lib';
// Call this when challenge is completed
await onChallengeResponse(true); // successful challenge
// or
await onChallengeResponse(false); // failed challenge
// When challenge expires
await onChallengeExpired();
// When an error occurs
await onChallengeError();