
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
@hcaptcha/vue3-hcaptcha
Advanced tools
hCaptcha Component Library for Vue.js. Compatible with Vue 2 and 3.
hCaptcha Component Library for Vue.js. Compatible with Vue 2 and 3.
You can install this library via npm with:
npm install @hcaptcha/vue-hcaptcha --save
npm install @hcaptcha/vue3-hcaptcha --save
or via yarn:
yarn add @hcaptcha/vue-hcaptcha
yarn add @hcaptcha/vue3-hcaptcha
or via script tag (Vue
must be globally available)
<script src="https://unpkg.com/vue@2"></script>
<script src="https://unpkg.com/@hcaptcha/vue-hcaptcha"></script>
<script src="https://unpkg.com/vue@3"></script>
<script src="https://unpkg.com/@hcaptcha/vue3-hcaptcha"></script>
vue2:
<template>
<vue-hcaptcha sitekey="**Your sitekey here**"></vue-hcaptcha>
</template>
<script>
import VueHcaptcha from '@hcaptcha/vue-hcaptcha';
export default {
...
components: { VueHcaptcha }
};
</script>
vue3:
<template>
<vue-hcaptcha sitekey="**Your sitekey here**"></vue-hcaptcha>
</template>
<script setup>
import VueHcaptcha from '@hcaptcha/vue3-hcaptcha';
</script>
The component will automatically load the hCaptcha API library and append it to the root component.
Name | Values/Type | Required | Default | Description |
---|---|---|---|---|
sitekey | String | Yes | - | Your sitekey. Please visit hCaptcha and sign up to get a sitekey. |
size | String (normal, compact, invisible) | No | normal | This specifies the "size" of the checkbox. hCaptcha allows you to decide how big the component will appear on render. Defaults to normal. |
theme | String (light, dark) | No | light | hCaptcha supports both a light and dark theme. If no theme is set, the API will default to light. |
tabindex | Integer | No | 0 | Set the tabindex of the widget and popup. When appropriate, this can make navigation of your site more intuitive. |
language | String (ISO 639-2 code) | No | auto | hCaptcha auto-detects language via the user's browser. This overrides that to set a default UI language. |
reCaptchaCompat | Boolean | No | true | Disable drop-in replacement for reCAPTCHA with false to prevent hCaptcha from injecting into window.grecaptcha. |
challengeContainer | String | No | - | A custom element ID to render the hCaptcha challenge. |
rqdata | String | No | - | See Enterprise docs. |
sentry | Boolean | No | - | See Enterprise docs. |
custom | Boolean | No | - | See Enterprise docs. |
apiEndpoint | String | No | - | See Enterprise docs. |
endpoint | String | No | - | See Enterprise docs. |
reportapi | String | No | - | See Enterprise docs. |
assethost | String | No | - | See Enterprise docs. |
imghost | String | No | - | See Enterprise docs. |
Event | Params | Description |
---|---|---|
error | err | When an error occurs. Component will reset immediately after an error. |
verify | token, eKey | When 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 closed. |
reset | - | When the challenge is reset. |
rendered | - | When the challenge is rendered. |
executed | - | When the challenge is executed. |
Method | Description |
---|---|
execute() | Programmatically trigger a challenge request |
executeAsync() | Similar to execute but it returns a Promise . |
reset() | Reset the current challenge |
Sign up at hCaptcha to get your sitekey. Check documentation for more information.
hCaptcha is a drop-in replacement for reCAPTCHA that earns websites money and helps companies get their data labeled.
Yes, in the enterprise version: see hCaptcha Enterprise (BotStop) for details.
To run the demo:
git clone https://github.com/hCaptcha/vue-hcaptcha.git
cd examples/traditional-vue2
yarn && yarn serve
TypeScript is supported. You can see example apps for both vue2
and vue3
in examples
directory.
yarn lint
- will check for lint issuesyarn test
- will test both vue2 and vue3 packagesyarn build
- will build the production vue2,3 versionsTo publish a new version, follow the next steps:
vue2/package.json
and vue3/package.json
(keep them in sync)CHANGES.md
with change detailsvue-hcaptcha
is developed and maintained through the collective efforts of the hCaptcha community.
This includes developers like you! We welcome your issues, suggestions, and PRs.
Notable contributors for larger changes:
1.3.0
custom
propFAQs
hCaptcha Component Library for Vue.js. Compatible with Vue 2 and 3.
We found that @hcaptcha/vue3-hcaptcha demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.