Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hcaptcha/vue-hcaptcha

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hcaptcha/vue-hcaptcha

hCaptcha Component Library for Vue.js, compatible with Vue 2+.

  • 0.3.0-alpha1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.9K
increased by18.97%
Maintainers
4
Weekly downloads
 
Created
Source

Vue.js hCaptcha Component Library

hCaptcha Component Library for Vue.js, compatible with Vue 2+.

Installation

You can install this library via npm with:

npm install @hcaptcha/vue-hcaptcha --save

or via yarn:

yarn add @hcaptcha/vue-hcaptcha

or via script tag (Vue must be globally available)

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/@hcaptcha/vue-hcaptcha"></script>
Basic Usage
<template>
    <vue-hcaptcha sitekey="**Your sitekey here**"></vue-hcaptcha>
</template>

<script>
  import VueHcaptcha from '@hcaptcha/vue-hcaptcha';
  export default {
    ...
    components: { VueHcaptcha }
  };
</script>

The component will automatically include and load the hCaptcha API library and append it to the root component. This is designed for ease of use with the hCaptcha API!

Api

Props
NameValues/TypeRequiredDefaultDescription
sitekeyStringYes-This is your sitekey, this allows you to load captcha. If you need a sitekey, please visit hCaptcha, and sign up to get your sitekey.
sizeString (normal, compact, invisible)NonormalThis specifies the "size" of the component. hCaptcha allows you to decide how big the component will appear on render, this always defaults to normal.
themeString (light, dark)NolighthCaptcha supports both a light and dark theme. If no theme is inherently set, the captcha will always default to light.
tabindexIntegerNo0Set the tabindex of the widget and popup. When appropriate, this can make navigation of your site more intuitive.
languageString (ISO 639-2 code)NoautohCaptcha auto-detects language via the user's browser. This overrides that to set a default UI language.
reCaptchaCompatBooleanNotrueDisable drop-in replacement for reCAPTCHA with false to prevent hCaptcha from injecting into window.grecaptcha.
challengeContainerStringNo-A custom element id to render the hCaptcha challenge.
rqdataStringNo-See Enterprise docs.
sentryBooleanNo-See Enterprise docs.
apiEndpointStringNo-See Enterprise docs.
endpointStringNo-See Enterprise docs.
reportapiStringNo-See Enterprise docs.
assethostStringNo-See Enterprise docs.
imghostStringNo-See Enterprise docs.
Events
EventParamsDescription
errorerrWhen an error occurs. Component will reset immediately after an error.
verifytoken, eKeyWhen challenge is completed. The token and an eKey are passed along.
expired-When the current token expires.
challengeExpired-When the unfinished challenge expires.
opened-When the challenge is opened.
closed-When the challenge is opened.
reset-When the challenge is reset.
rendered-When the challenge is rendered.
executed-When the challenge is executed.

Methods

MethodDescription
execute()Programmatically trigger a challenge request
reset()Reset the current challenge

FAQ

How can I get a sitekey?

Sign up at hCaptcha to get your sitekey today. Check documentation for more information.

What is hCaptcha?

hCaptcha is a drop-in replacement for reCAPTCHA that earns websites money and helps companies get their data labeled.

Demo

Demo

To run the demo, simply npm run serve after downloading the repo, this will start a development server on localhost:8080. Open your console to see the demo app emitting events.

To test locally, you can run the following NPM commands:

  • npm run serve
    • This initiates the hot reload dev server from the vue-cli
  • npm run build
    • This will build your version of the component with your customizations for production.
  • npm run lint and npm run lint:fix
    • This will enable ESLint to help keep your code clean!

TypeScript

Please see the DefinitelyTyped entry.

Note for maintainers: Publishing npm package

Using the proper credentials (granted to @Hcaptcha org), you'll need to do the following to publish:

  • npm login
  • Bump version in package.json
  • Commit changes
  • npm publish .

Keywords

FAQs

Package last updated on 22 Jan 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc