UNPKG

vue-recaptcha

Version:

ReCAPTCHA vue component

14 lines (13 loc) 379 B
import { ref } from "vue-demi"; import { useAssertV3SiteKey, useRecaptchaProxy } from "./context.mjs"; export function useChallengeV3(action) { const siteKey = useAssertV3SiteKey(); const proxy = useRecaptchaProxy(); const response = ref(); return { response, async execute() { return response.value = await proxy.execute(siteKey, { action }); } }; }