I'm not sure how to use this
📚 Is your documentation request related to a problem?
I don't know how to use this.
🔍 Where should you find it?
I feel I you need a minimal working example usage right in the beginning.
ℹ️ Additional context
I have one request and a couple of questions.
First the request. Can you write a minimal working example usage of this in a nuxt form/component?
Assuming I have the flag addValidateEndpoint turned on, my questions are:
- In the usage you show the following:
<NuxtTurnstile v-model="token" />
My question is, do I need to generate this token or can I just remove this v-model? If I need to generate tokens, can you show an example of how?
- You also show this:
<template>
<NuxtTurnstile ref="turnstile" />
<button @click="turnstile.reset()">Reset token in template</button>
<button @click="reset()">Reset token from handler</button>
</template>
<script setup>
// you can call this template ref anything
const turnstile = ref()
function reset() {
turnstile.value?.reset()
}
</script>
I don't understand much here. Do I need to do this?
- What is the minimal code I need to write to get turnstile to work with
addValidateEndpointturned on?
Thanks.
You can see an example here: https://github.com/nuxt-modules/turnstile/blob/main/playground/pages/index.vue
I always look for the "example" directory. Will have to start looking for playground as well for nuxt projects at least. Thanks.