useGoogleReCaptcha
Composable for accessing Google reCAPTCHA functionality in Vue applications
const {
instance,
isLoading,
language,
siteKey,
executeV3,
executeV2Invisible,
reset,
getResponse,
render,
} = useGoogleReCaptcha();
Return Value
Property | Type | Description |
---|---|---|
instance | GoogleReCaptcha.Instance | undefined | The reCAPTCHA instance. |
isLoading | boolean | Whether the reCAPTCHA script is still loading. |
language | string | undefined | The language code used for reCAPTCHA. |
siteKey | string | The site key used for reCAPTCHA. |
executeV3 | (action: string) => Promise<string> | Executes reCAPTCHA v3 verification. Returns a promise that resolves to the verification token. |
executeV2Invisible | (optWidgetId?: string) => Promise<void> | Executes reCAPTCHA v2 invisible verification. |
reset | (optWidgetId?: string) => void | Resets the reCAPTCHA widget. |
getResponse | (optWidgetId?: string) => string | Gets the current reCAPTCHA response token. |
render | (container: string | HTMLElement, parameters?: GoogleReCaptcha.Parameters, inherit?: boolean) => number | Renders the reCAPTCHA widget. |
Last updated on