An HCaptcha component for Svelte projects.
The hCaptcha Component Library for SvelteJS offers a secure and privacy-centric alternative to traditional reCAPTCHA systems. By helping to validate whether users are human, it not only protects user privacy but also rewards websites and enhances data labeling for companies. Integrating hCaptcha into your SvelteJS application is straightforward, requiring just a sitekey and a parent component like a form.
Designed for seamless usability, this library takes inspiration from the popular react-hcaptcha, making it user-friendly and efficient for developers looking to implement human verification on their sites. The built-in functionalities ensure that you can easily manage user interactions and handle potential errors effectively.
Easy Installation: Install via npm with a simple command (npm install svelte-hcaptcha --save-dev) to get started quickly.
Sitekey Requirement: Requires a sitekey prop to function, which can be easily obtained through the hCaptcha sign-up process.
Automatic API Loading: The component loads the hCaptcha API automatically, appending it to the parent component to reduce setup time and complexity.
Event Dispatching: Captures various events like mount, load, success, error, close, and expired, allowing developers to easily react to user interactions.
Reset Functionality: Exposes a .reset() method to allow for easy resetting of the captcha, particularly useful if verification fails.
Localization Support: Offers the ability to enforce specific localizations, helping to cater to a wider audience and enhance user experience.
Customization Options: Supports theming with options for light or dark modes, enabling developers to maintain consistent branding.
No Localhost Restrictions: Although you can’t develop on localhost, tools like ngrok facilitate easy testing, broadening development flexibility.