1.1.0 • Published 9 months ago

@getjoystick/vue-turnstile v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

vue-turnstile

Latest Stable 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' \| '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''
render-on-mountBooleanAutomatically render Turnstile widget after component mountsNotrue
remove-before-unmountBooleanAutomatically remove the Turnstile widget in beforeUnmountNotrue

Methods

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

Author

Original author of the library is: Rui Gomes
https://ruigomes.me

Fork is maintained and published by: Joystick https://getjoystick.com

License

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

1.1.0

9 months ago

1.0.0-alpha.1

9 months ago