Skip to main content

CAPTCHA Plugin Reference

@supertokens-plugins/captcha-react

init

Function
The function that initializes the plugin.
PARAMETERS
NameTypeRequired
config
SuperTokensPluginCaptchaConfig
Yes
Configuration for the React Captcha plugin.
PROPERTIES
NameTypeRequired
type
'reCAPTCHAv3' | 'reCAPTCHAv2' | 'turnstile'
Yes
captcha
ReCAPTCHAv3Config | ReCAPTCHAv2Config | TurnstileConfig
Yes
InputContainer
CaptchaInputContainerComponent
-
inputContainerId
string | (() => Promise<string>)
-

useCaptcha

Function
Hook that returns utilities to properly initialize captcha, and a state property. It's used to conditionally load and render the captcha in a React component.
PARAMETERS
NameTypeRequired
onError
(error: string) => void
-

@supertokens-plugins/captcha-nodejs

init

Function
The function that initializes the plugin.
PARAMETERS
NameTypeRequired
config
SuperTokensPluginCaptchaConfig
Yes
Configuration for the NodeJS Captcha plugin.
PROPERTIES
NameTypeRequired
type
'reCAPTCHAv3' | 'reCAPTCHAv2' | 'turnstile'
Yes
captcha
{ secretKey: string }
Yes
shouldValidate
ShouldValidate
-