Skip to content

useCaptchaConfig

useCaptchaConfig(): UseQueryResult<CaptchaConfig, Error>

Hook to get the CAPTCHA configuration from the server Use this to determine which CAPTCHA provider to load

UseQueryResult<CaptchaConfig, Error>

function AuthPage() {
const { data: captchaConfig, isLoading } = useCaptchaConfig();
if (isLoading) return <Loading />;
return captchaConfig?.enabled ? (
<CaptchaWidget provider={captchaConfig.provider} siteKey={captchaConfig.site_key} />
) : null;
}