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

vue-turnstile

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-turnstile

Vue library for Cloudflare Turnstile CAPTCHA alternative

  • 1.0.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

vue-turnstile

npm version

A Cloudflare Turnstile library for Vue 3

Installation

Add vue-turnstile to your Javascript project dependencies using Yarn:

yarn add vue-turnstile

Or NPM:

npm install vue-turnstile --save

Usage

<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>

Customization options

PropTypeDescriptionRequiredDefault
site-keyStringYour Turnstile sitekey - DocsYesN/A
v-modelStringBinding that contains the token returned by the Turnstile widgetYesN/A
reset-intervalNumberGet a fresh token after reset-interval milliseconds - Turnstile tokens only last for 5 minutesNo295000
size'normal' | 'flexible' | 'compact'Widget sizeNo'normal'
theme'light' | 'dark' | 'auto'Widget theme - auto respects the user's browser preferenceNo'auto'
actionStringA 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 - DocsNo'always'
render-on-mountBooleanAutomatically render Turnstile widget after component mountsNotrue
languageStringLanguage to display - ISO 639-1 two-letter language code - Supported languagesNoauto

Methods

MethodDescription
reset()Resets the widget
render()Renders the widget

Events

MethodParamsDescription
@errorcodeCallback 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.

Author

Rui Gomes
https://ruigomes.me

License

The MIT License (MIT). Please see LICENSE file for more information.

Keywords

FAQs

Package last updated on 20 Aug 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

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