isRecaptchaEnabled(): boolean¶
The isRecaptchaEnabled method returns information about whether the Recaptcha is enabled in the shop or not.
Returned value¶
A returned value has a type of boolean. If Recaptcha is enabled the returned value is true, otherwise it's false.
Example¶
In this example we make a RecaptchaV3Api call to check whether the Recaptcha is enabled in the shop or not.
useStorefront(async (storefront) => {
const recaptchaApi = await storefront.getApi('RecaptchaV3Api');
const isRecaptchaEnabled = await recaptchaApi.isRecaptchaEnabled();
if (isRecaptchaEnabled === true) {
// do something with Recaptcha
}
});