0.0.11 • Published 10 months ago

formkit-honeypot v0.0.11

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

FormKit HoneyPot

Prevent spam in your Vue.js + FormKit applications.

Learn how honeypot fields work

npm i formkit-honeypot vue @formkit/vue
<script setup lang="ts">
  import { ref } from 'vue'
  import FormKitHoneypot from 'formkit-honeypot'

  const honeypot = ref<InstanceType<typeof FormKitHoneypot>>()
  // const honeypot = useTemplateRef() (Vue 3.5 +)

  function formHandler(form) {
    if (!honeypot.value?.isSpam()) {
      // submit the form only for humans
    }

    // show your confirmation to bots and people alike
  }
</script>

<template>
  <FormKit type="form" @submit="formHandler">
    <!-- Other legit fields here...-->
    <FormKitHoneypot name="website" ref="honeypot" />
  </FormKit>
</template>

Props

  • name - should be something bots are tempted to fill in (not something they'd want to avoid like "honeypot") - defaults to website. If you are collecting a "website" field on your form for real, you'll want to change this, otherwise the default is fine.

  • ref - not really a prop. Enables template refs. See Vue docs for more info

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago