0.6.3 • Published 12 months ago

@gaviti/vue-turnstile v0.6.3

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

Vue Turnstile

A Vue 2.7.x component wrapper for Cloudflare's Turnstile

Installation

NPM

npm install @gaviti/vue-turnstile

Yarn

yarn add @gaviti/vue-turnstile

Installation for Vue 3.3.x

For Vue 3.3.x support, you should install a version of this package greater than or equal to 1.0.0. For the code corresponding to version 1.0.0 (Vue 3) and above, please refer to the "next" branch.

Usage

<template>
  <div>
    <vue-turnstile @verified="token = $event" />
    <div>Token: {{ token }}</div>
  </div>
</template>

<script>
import VueTurnstile from '@gaviti/vue-turnstile';

export default {
  components: {
    VueTurnstile
  },
  data() {
    return {
      token: null,
    };
  },
};
</script>

Customization options

PropTypeDescriptionRequiredDefault
site-keyStringYour Turnstile sitekey - DocsYesN/A
theme'light' \| 'dark' \| 'auto'Widget themeNo'auto'
size'normal' \| 'compact'Widget sizeNo'normal'
auto-resetBooleanAllow to refresh the token after some time (in milliseconds)Nofalse
reset-timeoutNumberRefresh the token after some time (in milliseconds) * requires auto-reset to be trueNo295000
recaptcha-compatBooleanAdds recaptcha compatibility layerNofalse
explicit-renderBooleanRenders the widget explicitlyNofalse
appearance'always' \| 'execute' \| 'interaction-only'Appearance controls when the widget is visible - DocsNoalways
LanguageStringLanguage to display - ISO 639-1 two-letter language code - Supported languagesNoauto

Methods

MethodDescription
render()Render the widget
reset()Reset the widget
remove()Remove the widget
execute()Generate a new token

Events

NameParamsDescription
@verifiedReturns the token
@renderingEmitted on mounted (returns nothing)
@renderedEmitted at the end of render (returns nothing)
@errorcodeCallback invoked when there is an error (e.g. network error or the challenge failed).

Slots

NameDescription
defaultDefault slot

License

MIT License

Copyright (c) 2023 Gaviti

1.1.1

1 year ago

1.1.0

1 year ago

1.1.2

12 months ago

0.6.3

12 months ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

0.5.2

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.5.1

1 year ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago

0.5.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago