1.0.8 • Published 3 months ago

vue-turnstile v1.0.8

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

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' \| '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.

Author

Rui Gomes
https://ruigomes.me

License

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

1.0.8

3 months ago

1.0.7

4 months ago

1.0.6

5 months ago

1.0.5

6 months ago

1.0.2

8 months ago

1.0.1

9 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.0

1 year ago