Socket
Socket
Sign inDemoInstall

invisible-grecaptcha

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

2

dist/index.js

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

var e="_grecaptchaonloadcallback";function n(e){return"string"==typeof e||e instanceof String}function t(e,n){return new TypeError("param "+e+" has an unexpected type, a "+n+" is expected.")}function o(e){var n=e.sitekey,t=e.resolve,o=e.position,r=window.grecaptcha.render(function(){i();var e=document.createElement("div");return e.id="invisible-captcha",document.body.appendChild(e),e}(),{sitekey:n,callback:t,size:"invisible",badge:o});window.grecaptcha.execute(r)}function i(){var e=document.getElementById("invisible-captcha");e&&e.parentNode.removeChild(e)}var r=i;exports.execute=function(i,r){var c=r.locale;void 0===c&&(c="en");var a=r.position;return void 0===a&&(a="bottomright"),new Promise(function(r,s){return function(e,n){if(null===e||void 0===e)throw new TypeError("param "+n+" is required")}(i,"sitekey"),n(i)||s(t("sitekey","string")),n(a)||s(t("position","string")),n(c)||s(t("locale","string")),new Promise(function(n,t){window.grecaptcha?o({sitekey:i,resolve:n,position:a}):function(n){return new Promise(function(t,o){var i="https://www.google.com/recaptcha/api.js?onload="+encodeURIComponent(e)+(!1===n?"":"&hl="+encodeURIComponent(n));window[e]=t;var r=document.createElement("script");r.type="text/javascript",r.src=i,r.onerror=function(e){o(new URIError("The script "+e.target.src+" is not accessible."))},document.head.appendChild(r)})}(c).then(function(){o({sitekey:i,resolve:n,position:a})}).catch(t)})})},exports.destroy=r;
var e="_grecaptchaonloadcallback";function t(e){return"string"==typeof e||e instanceof String}function n(e,t){return new TypeError("param "+e+" has an unexpected type, a "+t+" is expected.")}function r(e){var t=e.sitekey,n=e.position,r=e.resolve,i=e.reject,c=window.grecaptcha.render(function(){o();var e=document.createElement("div");return e.id="invisible-captcha",document.body.appendChild(e),e}(),{sitekey:t,size:"invisible",badge:n,callback:r,"error-callback":i});window.grecaptcha.execute(c)}function o(){var e=document.getElementById("invisible-captcha");e&&e.parentNode.removeChild(e)}var i=o;exports.execute=function(o,i){void 0===i&&(i={});var c=i.locale;void 0===c&&(c="en");var a=i.position;return void 0===a&&(a="bottomright"),new Promise(function(i,s){return function(e,t){if(null===e||void 0===e)throw new TypeError("param "+t+" is required")}(o,"sitekey"),t(o)||s(n("sitekey","string")),t(a)||s(n("position","string")),t(c)||s(n("locale","string")),new Promise(function(t,n){window.grecaptcha?r({sitekey:o,position:a,resolve:t,reject:n}):function(t){return new Promise(function(n,r){var o="https://www.google.com/recaptcha/api.js?onload="+encodeURIComponent(e)+(!1===t?"":"&hl="+encodeURIComponent(t));window[e]=n;var i=document.createElement("script");i.type="text/javascript",i.src=o,i.onerror=function(e){r(new URIError("The script "+e.target.src+" is not accessible."))},document.head.appendChild(i)})}(c).then(function(){r({sitekey:o,position:a,resolve:t,reject:n})}).catch(n)})})},exports.destroy=i;
//# sourceMappingURL=index.js.map

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

var e="_grecaptchaonloadcallback";function n(e){return"string"==typeof e||e instanceof String}function t(e,n){return new TypeError("param "+e+" has an unexpected type, a "+n+" is expected.")}function i(e){var n=e.sitekey,t=e.resolve,i=e.position,r=window.grecaptcha.render(function(){o();var e=document.createElement("div");return e.id="invisible-captcha",document.body.appendChild(e),e}(),{sitekey:n,callback:t,size:"invisible",badge:i});window.grecaptcha.execute(r)}function o(){var e=document.getElementById("invisible-captcha");e&&e.parentNode.removeChild(e)}function r(o,r){var c=r.locale;void 0===c&&(c="en");var a=r.position;return void 0===a&&(a="bottomright"),new Promise(function(r,s){return function(e,n){if(null===e||void 0===e)throw new TypeError("param "+n+" is required")}(o,"sitekey"),n(o)||s(t("sitekey","string")),n(a)||s(t("position","string")),n(c)||s(t("locale","string")),new Promise(function(n,t){window.grecaptcha?i({sitekey:o,resolve:n,position:a}):function(n){return new Promise(function(t,i){var o="https://www.google.com/recaptcha/api.js?onload="+encodeURIComponent(e)+(!1===n?"":"&hl="+encodeURIComponent(n));window[e]=t;var r=document.createElement("script");r.type="text/javascript",r.src=o,r.onerror=function(e){i(new URIError("The script "+e.target.src+" is not accessible."))},document.head.appendChild(r)})}(c).then(function(){i({sitekey:o,resolve:n,position:a})}).catch(t)})})}var c=o;export{r as execute,c as destroy};
var e="_grecaptchaonloadcallback";function n(e){return"string"==typeof e||e instanceof String}function t(e,n){return new TypeError("param "+e+" has an unexpected type, a "+n+" is expected.")}function r(e){var n=e.sitekey,t=e.position,r=e.resolve,i=e.reject,c=window.grecaptcha.render(function(){o();var e=document.createElement("div");return e.id="invisible-captcha",document.body.appendChild(e),e}(),{sitekey:n,size:"invisible",badge:t,callback:r,"error-callback":i});window.grecaptcha.execute(c)}function o(){var e=document.getElementById("invisible-captcha");e&&e.parentNode.removeChild(e)}function i(o,i){void 0===i&&(i={});var c=i.locale;void 0===c&&(c="en");var a=i.position;return void 0===a&&(a="bottomright"),new Promise(function(i,s){return function(e,n){if(null===e||void 0===e)throw new TypeError("param "+n+" is required")}(o,"sitekey"),n(o)||s(t("sitekey","string")),n(a)||s(t("position","string")),n(c)||s(t("locale","string")),new Promise(function(n,t){window.grecaptcha?r({sitekey:o,position:a,resolve:n,reject:t}):function(n){return new Promise(function(t,r){var o="https://www.google.com/recaptcha/api.js?onload="+encodeURIComponent(e)+(!1===n?"":"&hl="+encodeURIComponent(n));window[e]=t;var i=document.createElement("script");i.type="text/javascript",i.src=o,i.onerror=function(e){r(new URIError("The script "+e.target.src+" is not accessible."))},document.head.appendChild(i)})}(c).then(function(){r({sitekey:o,position:a,resolve:n,reject:t})}).catch(t)})})}var c=o;export{i as execute,c as destroy};
//# sourceMappingURL=index.m.js.map

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.invisibleGrecaptcha={})}(this,function(e){var n="_grecaptchaonloadcallback";function t(e){return"string"==typeof e||e instanceof String}function i(e,n){return new TypeError("param "+e+" has an unexpected type, a "+n+" is expected.")}function o(e){var n=e.sitekey,t=e.resolve,i=e.position,o=window.grecaptcha.render(function(){r();var e=document.createElement("div");return e.id="invisible-captcha",document.body.appendChild(e),e}(),{sitekey:n,callback:t,size:"invisible",badge:i});window.grecaptcha.execute(o)}function r(){var e=document.getElementById("invisible-captcha");e&&e.parentNode.removeChild(e)}var c=r;e.execute=function(e,r){var c=r.locale;void 0===c&&(c="en");var a=r.position;return void 0===a&&(a="bottomright"),new Promise(function(r,s){return function(e,n){if(null===e||void 0===e)throw new TypeError("param "+n+" is required")}(e,"sitekey"),t(e)||s(i("sitekey","string")),t(a)||s(i("position","string")),t(c)||s(i("locale","string")),new Promise(function(t,i){window.grecaptcha?o({sitekey:e,resolve:t,position:a}):function(e){return new Promise(function(t,i){var o="https://www.google.com/recaptcha/api.js?onload="+encodeURIComponent(n)+(!1===e?"":"&hl="+encodeURIComponent(e));window[n]=t;var r=document.createElement("script");r.type="text/javascript",r.src=o,r.onerror=function(e){i(new URIError("The script "+e.target.src+" is not accessible."))},document.head.appendChild(r)})}(c).then(function(){o({sitekey:e,resolve:t,position:a})}).catch(i)})})},e.destroy=c});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.invisibleGrecaptcha={})}(this,function(e){var n="_grecaptchaonloadcallback";function t(e){return"string"==typeof e||e instanceof String}function o(e,n){return new TypeError("param "+e+" has an unexpected type, a "+n+" is expected.")}function i(e){var n=e.sitekey,t=e.position,o=e.resolve,i=e.reject,c=window.grecaptcha.render(function(){r();var e=document.createElement("div");return e.id="invisible-captcha",document.body.appendChild(e),e}(),{sitekey:n,size:"invisible",badge:t,callback:o,"error-callback":i});window.grecaptcha.execute(c)}function r(){var e=document.getElementById("invisible-captcha");e&&e.parentNode.removeChild(e)}var c=r;e.execute=function(e,r){void 0===r&&(r={});var c=r.locale;void 0===c&&(c="en");var a=r.position;return void 0===a&&(a="bottomright"),new Promise(function(r,s){return function(e,n){if(null===e||void 0===e)throw new TypeError("param "+n+" is required")}(e,"sitekey"),t(e)||s(o("sitekey","string")),t(a)||s(o("position","string")),t(c)||s(o("locale","string")),new Promise(function(t,o){window.grecaptcha?i({sitekey:e,position:a,resolve:t,reject:o}):function(e){return new Promise(function(t,o){var i="https://www.google.com/recaptcha/api.js?onload="+encodeURIComponent(n)+(!1===e?"":"&hl="+encodeURIComponent(e));window[n]=t;var r=document.createElement("script");r.type="text/javascript",r.src=i,r.onerror=function(e){o(new URIError("The script "+e.target.src+" is not accessible."))},document.head.appendChild(r)})}(c).then(function(){i({sitekey:e,position:a,resolve:t,reject:o})}).catch(o)})})},e.destroy=c});
//# sourceMappingURL=index.umd.js.map
{
"name": "invisible-grecaptcha",
"version": "1.0.2",
"version": "1.0.3",
"description": "Invisible reCAPTCHA integration",

@@ -5,0 +5,0 @@ "source": "src/index.js",

@@ -61,3 +61,5 @@ # invisible-grecaptcha

Create an invisible grecaptcha and returns the recaptcha token.
Creates an invisible reCAPTCHA instance, dynamically loading Google's library if necessary, and then returns a user
response token. This is a client-side step, and the token must be sent to the server side for verification as a
separate step. Tokens are single use and can be verified only once.

@@ -67,3 +69,3 @@ **Parameters**

- `sitekey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Your recaptcha sitekey. You can get one here: <https://www.google.com/recaptcha/admin>.
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options to create a invisible recaptcha.
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The options to create an invisible reCAPTCHA. (optional, default `{}`)
- `options.locale` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Language of the captcha. See available language codes <https://developers.google.com/recaptcha/docs/language>. Auto-detects the user's language if unspecified. (optional, default `en`)

@@ -70,0 +72,0 @@ - `options.position` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Position the reCAPTCHA badge. Values: bottomright, bottomleft and inline. (optional, default `bottomright`)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc