Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-google-recaptcha-hook

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-google-recaptcha-hook - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

dist/react-google-recaptcha-hook.cjs.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var r=require("react");const s=()=>{var c;typeof window.grecaptcha=="undefined"&&((c=window.___grecaptcha_cfg)!=null||(window.___grecaptcha_cfg={fns:[]}),window.grecaptcha={ready:e=>{window.___grecaptcha_cfg.fns.push(e)}})},d=()=>new Promise(c=>{s(),window.grecaptcha.ready(()=>c(window.grecaptcha))}),l=(c,e)=>{const t=e!=null&&e.language?`&hl=${e.language}`:"",n=e!=null&&e.enterprise?"enterprise.js":"api.js";return`https://www.${e!=null&&e.recaptchaNet?"recaptcha.net":"google.com"}/recaptcha/${n}?render=${c}${t}`},w=(c,e)=>{const t=r.useCallback(()=>{if(document.getElementById(c))return;const a=document.createElement("script");a.async=!0,a.type="text/javascript",a.src=l(c,e),a.id=c,document.getElementsByTagName("head")[0].appendChild(a)},[]),n=r.useCallback(async a=>{var h;const g=await d();return(h=g.execute)==null?void 0:h.call(g,c,{action:a})},[]),u=r.useRef(!1);return r.useEffect(()=>{u.current||(u.current=!0,t())},[t]),{executeGoogleReCaptcha:n,load:t}};exports.generateGrecaptchaSrc=l;exports.getGrecaptcha=d;exports.initGrecaptcha=s;exports.useGoogleReCaptcha=w;
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var r=require("react");const s=()=>{var c;typeof window.grecaptcha=="undefined"&&((c=window.___grecaptcha_cfg)!=null||(window.___grecaptcha_cfg={fns:[]}),window.grecaptcha={ready:e=>{window.___grecaptcha_cfg.fns.push(e)}})},d=()=>new Promise(c=>{s(),window.grecaptcha.ready(()=>c(window.grecaptcha.enterprise||window.grecaptcha))}),l=(c,e)=>{const t=e!=null&&e.language?`&hl=${e.language}`:"",n=e!=null&&e.enterprise?"enterprise.js":"api.js";return`https://www.${e!=null&&e.recaptchaNet?"recaptcha.net":"google.com"}/recaptcha/${n}?render=${c}${t}`},w=(c,e)=>{const t=r.useCallback(()=>{if(document.getElementById(c))return;const a=document.createElement("script");a.async=!0,a.type="text/javascript",a.src=l(c,e),a.id=c,document.getElementsByTagName("head")[0].appendChild(a)},[]),n=r.useCallback(async a=>{var h;const g=await d();return(h=g.execute)==null?void 0:h.call(g,c,{action:a})},[]),u=r.useRef(!1);return r.useEffect(()=>{u.current||(u.current=!0,t())},[t]),{executeGoogleReCaptcha:n,load:t}};exports.generateGrecaptchaSrc=l;exports.getGrecaptcha=d;exports.initGrecaptcha=s;exports.useGoogleReCaptcha=w;

@@ -17,3 +17,3 @@ import { useCallback, useRef, useEffect } from "react";

initGrecaptcha();
window.grecaptcha.ready(() => resolve(window.grecaptcha));
window.grecaptcha.ready(() => resolve(window.grecaptcha.enterprise || window.grecaptcha));
});

@@ -20,0 +20,0 @@ const generateGrecaptchaSrc = (siteKey, options) => {

@@ -20,3 +20,3 @@ {

"license": "MIT",
"version": "0.1.0",
"version": "0.1.1",
"files": [

@@ -39,2 +39,4 @@ "dist",

"coverage": "vitest run --coverage",
"lint:prettier": "prettier . --check --ignore-path .gitignore",
"fix:prettier": "prettier . --write --ignore-path .gitignore",
"prepare": "husky install"

@@ -41,0 +43,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc