google-recaptcha-v3
Version:
A React library for Google reCAPTCHA integration with both hooks and components supporting v2 and v3
32 lines • 1.12 kB
TypeScript
import React from "react";
export type ReCaptchaTheme = "light" | "dark";
export type ReCaptchaType = "image" | "audio";
export type ReCaptchaSize = "compact" | "normal" | "invisible";
export type ReCaptchaVersion = "v2" | "v3";
export interface GoogleRecaptchaProps {
sitekey: string;
theme?: ReCaptchaTheme;
type?: ReCaptchaType;
size?: ReCaptchaSize;
tabindex?: number;
onChange?: (token: string | null) => void;
onExpired?: () => void;
onErrored?: (error: Error) => void;
onLoad?: () => void;
action?: string;
version?: ReCaptchaVersion;
hl?: string;
badge?: "bottomright" | "bottomleft" | "inline";
isolated?: boolean;
className?: string;
style?: React.CSSProperties;
}
export interface GoogleRecaptchaRef {
execute: () => Promise<string | null>;
executeAsync: () => Promise<string>;
reset: () => void;
getResponse: () => string | null;
}
declare const GoogleRecaptcha: React.ForwardRefExoticComponent<GoogleRecaptchaProps & React.RefAttributes<GoogleRecaptchaRef>>;
export default GoogleRecaptcha;
//# sourceMappingURL=index.d.ts.map