
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
vue-turnstile
Advanced tools
A Cloudflare Turnstile library for Vue 3
Add vue-turnstile
to your Javascript project dependencies using Yarn:
yarn add vue-turnstile
Or NPM:
npm install vue-turnstile --save
<script lang="ts">
import VueTurnstile from 'vue-turnstile';
export default {
components: { VueTurnstile },
data() {
return {
token: '',
};
},
};
</script>
<template>
<div>
<vue-turnstile site-key="1x00000000000000000000AA" v-model="token" />
<div>Token: {{ token }}</div>
</div>
</template>
Prop | Type | Description | Required | Default |
---|---|---|---|---|
site-key | String | Your Turnstile sitekey - Docs | Yes | N/A |
v-model | String | Binding that contains the token returned by the Turnstile widget | Yes | N/A |
reset-interval | Number | Get a fresh token after reset-interval milliseconds - Turnstile tokens only last for 5 minutes | No | 295000 |
size | 'normal' | 'flexible' | 'compact' | Widget size | No | 'normal' |
theme | 'light' | 'dark' | 'auto' | Widget theme - auto respects the user's browser preference | No | 'auto' |
action | String | A customer value that can be used to differentiate widgets under the same sitekey in analytics and which is returned upon validation. | No | '' |
appearance | 'always' | 'execute' | 'interaction-only' | Appearance controls when the widget is visible - Docs | No | 'always' |
render-on-mount | Boolean | Automatically render Turnstile widget after component mounts | No | true |
language | String | Language to display - ISO 639-1 two-letter language code - Supported languages | No | auto |
Method | Description |
---|---|
reset() | Resets the widget |
render() | Renders the widget |
Method | Params | Description |
---|---|---|
@error | code | Callback invoked when there is an error (e.g. network error or the challenge failed). |
@unsupported | - | Callback invoked when a given client/browser is not supported by Turnstile. |
@expired | - | Callback invoked when the token expires and does not reset the widget. |
@before-interactive | - | Callback invoked before the challenge enters interactive mode. |
@after-interactive | - | callback invoked when challenge has left interactive mode. |
Rui Gomes
https://ruigomes.me
The MIT License (MIT). Please see LICENSE file for more information.
FAQs
Vue library for Cloudflare Turnstile CAPTCHA alternative
We found that vue-turnstile demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.