GoogleReCaptchaProvider

GoogleReCaptchaProvider

Provider component for Google reCAPTCHA integration in Vue applications

<GoogleReCaptchaProvider
  type
  siteKey
  language
  scriptProps
  isEnterprise
  host
  theme
  explicit
  @load
  @error
>
 ...
</GoogleReCaptchaProvider>

Props

Common Props

PropTypeRequiredDefaultDescription
type'v2-checkbox' | 'v2-invisible' | 'v3'Yes-The type of reCAPTCHA to use
siteKeystringYes-Your Google reCAPTCHA site key
languagestring--Language code for the reCAPTCHA widget
scriptPropsGoogleReCaptcha.Script--Additional properties for the reCAPTCHA script
isEnterpriseboolean-falseWhether to use reCAPTCHA Enterprise
hoststring--Custom host for the reCAPTCHA script
theme'light' | 'dark'-lightTheme of the reCAPTCHA widget

v3 props

PropTypeRequiredDefaultDescription
explicit.badge'bottomright' | 'bottomleft' | 'inline'--Position of the reCAPTCHA badge
explicit.tabIndexnumber--Tab index for the reCAPTCHA widget
explicit.callback(token: string) => void--Callback when verification is successful
explicit.errorCallback() => void--Callback when reCAPTCHA encounters an error
explicit.expiredCallback() => void--Callback when the reCAPTCHA response expires

v2 checkbox props

PropTypeRequiredDefaultDescription
explicit.containerstringYes-Container ID for the reCAPTCHA widget
explicit.actionstring--Action name for the reCAPTCHA
explicit.size'normal' | 'compact'--Size of the reCAPTCHA widget
explicit.tabIndexnumber--Tab index for the reCAPTCHA widget
explicit.callback(token: string) => void--Callback when verification is successful
explicit.errorCallback() => void--Callback when reCAPTCHA encounters an error
explicit.expiredCallback() => void--Callback when the reCAPTCHA response expires

v2 invisible props

PropTypeRequiredDefaultDescription
explicit.badge'bottomright' | 'bottomleft' | 'inline'--Position of the reCAPTCHA badge
explicit.tabIndexnumber--Tab index for the reCAPTCHA widget
explicit.callback(token: string) => void--Callback when verification is successful
explicit.errorCallback() => void--Callback when reCAPTCHA encounters an error
explicit.expiredCallback() => void--Callback when the reCAPTCHA response expires

Events

EventPayloadDescription
loadGoogleReCaptcha.InstanceEmitted when the reCAPTCHA is loaded
error-Emitted when an error occurs

Provide/Inject Values

PropertyTypeDescription
instanceGoogleReCaptcha.Instance | undefinedThe reCAPTCHA instance.
isLoadingbooleanWhether the reCAPTCHA script is still loading.
languagestring | undefinedThe language code used for reCAPTCHA.
siteKeystringThe 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) => voidResets the reCAPTCHA widget.
getResponse(optWidgetId?: string) => stringGets the current reCAPTCHA response token.
render(container: string | HTMLElement, parameters?: GoogleReCaptcha.Parameters, inherit?: boolean) => numberRenders the reCAPTCHA widget.

Last updated on