Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When will be supporting using nuxt3? #106

Open
KahrLu opened this issue Jun 2, 2022 · 3 comments
Open

When will be supporting using nuxt3? #106

KahrLu opened this issue Jun 2, 2022 · 3 comments

Comments

@KahrLu
Copy link

KahrLu commented Jun 2, 2022

No description provided.

@kosmeln
Copy link

kosmeln commented Jun 21, 2022

Would be nice to have any updates or roadmap plans for this

@mahdi-hsoumi
Copy link

mahdi-hsoumi commented Jun 23, 2022

any update,
This worked for me
abinnovision/vue-recaptcha-v3#609

@Vesely
Copy link

Vesely commented Jul 9, 2024

I've put together a simple composable using recaptcha-v3 and lazy inicialize.

// composables/useRecaptcha.js

import { load } from 'recaptcha-v3';

export const useRecaptcha = () => {
  let init;
  const recaptcha = ref(null);

  if (import.meta.client) {
    init = async(options) => {
      recaptcha.value = await load(useRuntimeConfig().public.recaptcha, {
        autoHideBadge: true,
        ...options,
      });
    };
  }

  return {
    init,
    recaptcha,
  };
};

Usage:

<template>
  <form @submit.prevent="submitForm">
    <button type="submit">Submit</button
  </form>
</template>

<script setup>
const { init, recaptcha } = useRecaptcha();

const submitForm = async() => {
  const token = await recaptcha.value?.execute('login');
  alert(token);
};

onMounted(() => {
  init();
});
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants