Socket
Book a DemoInstallSign in
Socket

@hcaptcha/loader

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hcaptcha/loader

This is a JavaScript library to easily configure the loading of the hCaptcha JS client SDK with built-in error handling.

Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
202K
63.96%
Maintainers
4
Weekly downloads
 
Created
Source

hCaptcha Loader

This is a JavaScript library to easily configure the loading of the hCaptcha JS client SDK with built-in error handling. It also includes a retry mechanism that will attempt to load the hCaptcha script several times in the event if fails to load due to a network or unforeseen issue.

hCaptcha is a drop-replacement for reCAPTCHA that protects user privacy.

Sign up at hCaptcha to get your sitekey today. You need a sitekey to use this library.

Installation

npm install @hcaptcha/loader

Implementation

import { hCaptchaLoader } from '@hcaptcha/loader';

await hCaptchaLoader();

hcaptcha.render({
  sitekey: '<your_sitekey>'
});

const { response } = await hcaptcha.execute({ async: true });

Props

NameValues/TypeRequiredDefaultDescription
loadAsyncBooleanNotrueSet if the script should be loaded asynchronously.
cleanupBooleanNotrueRemove script tag after setup.
crossOriginStringNo-Set script cross origin attribute such as "anonymous".
scriptSourceStringNohttps://js.hcaptcha.com/1/api.jsSet script source URI. Takes precedence over secureApi.
scriptLocationHTMLElementNodocument.headLocation of where to append the script tag. Make sure to add it to an area that will persist to prevent loading multiple times in the same document view.
secureApiBooleanNofalseSee enterprise docs.
apihostStringNo-See enterprise docs.
assethostStringNo-See enterprise docs.
endpointStringNo-See enterprise docs.
hlStringNo-See enterprise docs.
hostStringNo-See enterprise docs.
imghostStringNo-See enterprise docs.
recaptchacompatStringNo-See enterprise docs.
reportapiStringNo-See enterprise docs.
sentryBooleanNo-See enterprise docs.
customBooleanNo-See enterprise docs.

Keywords

hcaptcha

FAQs

Package last updated on 13 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts