Skip to content

A Vue 3 component for showing the Cloudflare Turnstile widget on your project.

License

Notifications You must be signed in to change notification settings

Astrian/cfturnstile-vue3

Repository files navigation

Cloudflare Turnstile Widget Component for Vue 3

A Vue 3 component for showing the Cloudflare Turnstile widget on your project.

What is Cloudflare Turnstile?

Cloudflare Turnstile is a CAPTCHA alternative from Cloudflare. It uses PAT protocol to verify the user’s devices, preventing bots and malicious users from accessing your site and ensuring your and your visitors’ privacy is protected.

Introduction for Cloudflare Turnstile

Showcases

Telegram Watchdog is a Telegram bot used for anti-abuse from Telegram group chats.

Get into Telegram Watchdog community to give a try

Installation & Usage

yarn add cfturnstile-vue3
# or
npm install cfturnstile-vue3
<script setup lang="ts">
import Turnstile from 'cfturnstile-vue3'
const sitekey = import.meta.env.VITE_SITEKEY as string
</script>

<template>
  <Turnstile 
    :sitekey="sitekey"
    @callback="e => console.log('success', e)"
    size="compact"
  />
</template>

Refer to official document for all configurations.

Upgrade from v1.0.0

We aligned the configuration parameters with the official widget document in version 2.0.0, which is disruptive for existing v1.0.0 users. Please remember to update the parameters to ensure that the widget works as normal.

About

A Vue 3 component for showing the Cloudflare Turnstile widget on your project.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published