recaptcha-node
Version:
A Node.js library to verify reCAPTCHA v2/v3 response tokens received from a client.
38 lines (37 loc) • 1.3 kB
TypeScript
declare type RecaptchaResultCreationAttrs = {
challenge_ts: string;
'error-codes'?: string[];
apk_package_name?: string;
hostname?: string;
success: boolean;
};
export declare abstract class RecaptchaResult {
/** Timestamp of the challenge load */
challengeTimestamp?: string;
errorCodes?: string[];
success: boolean;
constructor(attrs: RecaptchaResultCreationAttrs);
}
declare type RecaptchaV2ResultCreationAttrs = RecaptchaResultCreationAttrs;
export declare class RecaptchaV2Result extends RecaptchaResult {
/** The package name of the app where the reCAPTCHA was solved */
apkPackageName?: string;
/** The hostname of the site where the reCAPTCHA was solved */
hostname?: string;
constructor(attrs: RecaptchaV2ResultCreationAttrs);
}
declare type RecaptchaV3ResultCreationAttrs = RecaptchaResultCreationAttrs & {
action: string;
hostname: string;
score: number;
};
export declare class RecaptchaV3Result extends RecaptchaResult {
/** The action name for this request */
action: string;
/** The hostname of the site where the reCAPTCHA was solved */
hostname: string;
/** The score for this request (0.0 - 1.0) */
score: number;
constructor(attrs: RecaptchaV3ResultCreationAttrs);
}
export {};