{"_id":"recaptcha2","_rev":"29-3b55066bf00e51d8a8468209445f0050","name":"recaptcha2","time":{"modified":"2022-06-26T09:29:14.385Z","created":"2015-08-15T20:03:10.761Z","1.0.0":"2015-08-15T20:03:10.761Z","1.0.1":"2015-08-15T20:43:02.318Z","1.0.2":"2015-08-15T20:48:45.184Z","1.0.3":"2015-08-15T20:54:39.647Z","1.0.4":"2015-08-15T21:29:30.651Z","1.0.5":"2015-08-15T21:47:40.173Z","1.0.6":"2015-08-15T22:42:46.033Z","1.0.7":"2015-08-15T22:48:37.433Z","1.0.8":"2015-08-15T22:53:53.338Z","1.3.0":"2016-11-15T22:36:54.469Z","1.1.0":"2016-11-15T22:52:03.722Z","1.1.2":"2016-11-15T22:55:46.493Z","1.3.2":"2016-11-15T22:57:27.886Z","1.3.3":"2018-10-29T16:13:50.330Z"},"maintainers":[{"name":"fereidani","email":"info@fereidani.com"}],"dist-tags":{"latest":"1.3.3"},"description":"Easy API for Google reCAPTCHA version 2 for Node.js and Express","readme":"# reCAPTCHA2\nEasy verifier for Google reCAPTCHA version 2 for Node.js\n\n## How to use\n\n### Step 1: Setup reCAPTCHA on your site\n\nYou need to receive your site key and secret key for your domain from https://www.google.com/recaptcha/intro/.\n\nFollow the steps on this page to include the reCAPTCHA on your website.\n\n### Step 2: Initialize verifier\n```js\nvar reCAPTCHA = require('recaptcha2');\n\nvar recaptcha = new reCAPTCHA({\n  siteKey: 'your-site-key', // retrieved during setup\n  secretKey: 'your-secret-key' // retrieved during setup\n  ssl: false // optional, defaults to true.\n             // Disable if you don't want to access\n             // the Google API via a secure connection\n});\n```\n\n### Step 3: Verifying the reCAPTCHA response\n\nreCAPTCHA2 uses promises to validate the reCAPTCHA response, you can use one of the following methods:\n* please mention on catch, library passes error codes from google which you can translate with translateErrors method\n\n#### Simple usage:\n```js\nrecaptcha.validate(key)\n  .then(function(){\n    // validated and secure\n  })\n  .catch(function(errorCodes){\n    // invalid\n    console.log(recaptcha.translateErrors(errorCodes)); // translate error codes to human readable text\n  });\n```\n**Optional:** You can also pass the clients IP address to the validate method after the key. For more information on that, please see the [reCAPTCHA documentation](https://developers.google.com/recaptcha/docs/verify).\n\n#### For use with Express (you need body-parser):\n```js\nfunction submitForm(req, res) {\n  recaptcha.validateRequest(req)\n    .then(function(){\n      // validated and secure\n      res.json({formSubmit:true})\n    })\n    .catch(function(errorCodes){\n      // invalid\n      res.json({\n        formSubmit: false,\n        errors: recaptcha.translateErrors(errorCodes) // translate error codes to human readable text\n      });\n    });\n}\n```\n\n### Generating the reCAPTCHA widget\n\n`recaptcha.formElement()` returns standard form element for reCAPTCHA which you should include at the end of your html form element.\n\nYou can also set CSS classes like this: `recaptcha.formElement('custom-class-for-recaptcha')`.\nThe default class is `g-recaptcha`.\n\n```html\n<div class=\"custom-class-for-recaptcha\" data-sitekey=\"your-site-key\"></div>\n```\n\n## Changelog\n\nPlease see the [CHANGELOG.md](CHANGELOG.md).\n","versions":{"1.0.6":{"name":"recaptcha2","version":"1.0.6","description":"Easy verifier for google reCAPTCHA version 2","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@github.com/fereidani/recaptcha2.git"},"dependencies":{"bluebird":"2.x","request":"2.x"},"keywords":["recaptcha","captcha","security","csrf"],"author":{"name":"Khashayar Fereidani"},"license":"MIT","bugs":{"url":"https://github.com/fereidani/recaptcha2/issues"},"homepage":"https://github.com/fereidani/recaptcha2#readme","gitHead":"4f57d211efb3b7cabd379b51ce651a9bcb3a869d","_id":"recaptcha2@1.0.6","_shasum":"0dedf1ea1120b64883ec5e3ed5649b8a9062e973","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"fereidani","email":"info@fereidani.com"},"dist":{"shasum":"0dedf1ea1120b64883ec5e3ed5649b8a9062e973","tarball":"https://registry.npmjs.org/recaptcha2/-/recaptcha2-1.0.6.tgz","integrity":"sha512-L0eYEqNMkSXPlwDy5J6un0dO9Sl9saQX12xk30DgcQksDUA5TFyXGrKH4/8gq0V0Ztw5Rknrm2BRbErbjJjBRA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLjCWj5LpIdltHxGOQ0wRgPxmczRywaVu39bItfkGdXwIhANFDiuWnn97v+jdzT3HM465fLdhCj0lIouImny2vq/dw"}]},"maintainers":[{"name":"fereidani","email":"info@fereidani.com"}],"directories":{}},"1.0.7":{"name":"recaptcha2","version":"1.0.7","description":"Easy api for google reCAPTCHA version 2 for node.js and express.js","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@github.com/fereidani/recaptcha2.git"},"dependencies":{"bluebird":"2.x","request":"2.x"},"keywords":["recaptcha","captcha","security","csrf","express"],"author":{"name":"Khashayar Fereidani"},"license":"MIT","bugs":{"url":"https://github.com/fereidani/recaptcha2/issues"},"homepage":"https://github.com/fereidani/recaptcha2#readme","gitHead":"4f57d211efb3b7cabd379b51ce651a9bcb3a869d","_id":"recaptcha2@1.0.7","_shasum":"e05b2fb7fabfd6c101a47c9d502b139bf10bd724","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"fereidani","email":"info@fereidani.com"},"dist":{"shasum":"e05b2fb7fabfd6c101a47c9d502b139bf10bd724","tarball":"https://registry.npmjs.org/recaptcha2/-/recaptcha2-1.0.7.tgz","integrity":"sha512-9c1VGECcsgJ4kPlS56izuiXzYhd+pY7YVFCbaN5iRpiwWDHa4uETJen4hLZJQ/bQwTgVQrELVQfjEBYN+FyPXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFFZN3hlbBW/3bJyeY2wkI5O/LPGXXY015ORAGdR5BUSAiA5Xd1v/S3b9QZooKif8zzWGHsTLt16ntcydfp9NDXhFA=="}]},"maintainers":[{"name":"fereidani","email":"info@fereidani.com"}],"directories":{}},"1.0.8":{"name":"recaptcha2","version":"1.0.8","description":"Easy api for google reCAPTCHA version 2 for node.js and express.js","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@github.com/fereidani/recaptcha2.git"},"dependencies":{"bluebird":"2.x","request":"2.x"},"keywords":["recaptcha","captcha","security","csrf","express"],"author":{"name":"Khashayar Fereidani"},"license":"MIT","bugs":{"url":"https://github.com/fereidani/recaptcha2/issues"},"homepage":"https://github.com/fereidani/recaptcha2#readme","gitHead":"c22c284cd619c8ad69373eab3ab89ce0ee103ae3","_id":"recaptcha2@1.0.8","_shasum":"a8912a1dcc1a30c4ecb15885fd904d6a9161ce2f","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"fereidani","email":"info@fereidani.com"},"dist":{"shasum":"a8912a1dcc1a30c4ecb15885fd904d6a9161ce2f","tarball":"https://registry.npmjs.org/recaptcha2/-/recaptcha2-1.0.8.tgz","integrity":"sha512-fzVL/TLmnWuRnpQI8lGM4Yif7amTAErQIx/NUPzNcvHLK160AKHrNWK4JS+4MDfTh8YJbaufg+4f947Vg0CvkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxxjUqF7/vBPZ7b4bsTwpd2bX1ngTnVrk+ZRYXxe9ghAIgTwlo6S5CL6Rh6QQtE54hUk1tEtXu+Vxj3Y5WUQj50No="}]},"maintainers":[{"name":"fereidani","email":"info@fereidani.com"}],"directories":{}},"1.1.2":{"name":"recaptcha2","version":"1.1.2","description":"Easy api for google reCAPTCHA version 2 for node.js and express.js","main":"index.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --compilers coffee:coffee-script/register --recursive tests","compile":"coffee -c --no-header index.coffee"},"repository":{"type":"git","url":"git+ssh://git@github.com/fereidani/recaptcha2.git"},"dependencies":{"request":"2.x"},"devDependencies":{"coffee-script":"^1.11.1","mocha":"^2.5.3","nock":"^8.0.0","should":"^11.1.0"},"keywords":["recaptcha","captcha","security","csrf","express"],"author":{"name":"Khashayar Fereidani"},"license":"MIT","bugs":{"url":"https://github.com/fereidani/recaptcha2/issues"},"homepage":"https://github.com/fereidani/recaptcha2#readme","contributors":[{"name":"Khashayar Fereidani","email":"info@fereidani.com"},{"name":"Dumitru Glavan","email":"contact@dumitruglavan.com"}],"gitHead":"460480fafa1d97ec506ba68f152b9756073cceab","_id":"recaptcha2@1.1.2","_shasum":"6ee8d8c1c52658c0129f0e749e7b32dea303c932","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"fereidani","email":"info@fereidani.com"},"dist":{"shasum":"6ee8d8c1c52658c0129f0e749e7b32dea303c932","tarball":"https://registry.npmjs.org/recaptcha2/-/recaptcha2-1.1.2.tgz","integrity":"sha512-bgkhKzys8vT2rLJ6YRZrCYYRf+oI9G5BFln33jflenFL76j1mBubvDZsDhovE7d/brabfH0tYcDqnC0iBZfsUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAX1u4A6HDU9gl4VtS/v/ezRHhn17RJbVd+XZKZuvszvAiEAgotxc4vlxHWdu+RDvI4OE3hK7xLUlJyepSt+k7uX6yE="}]},"maintainers":[{"name":"fereidani","email":"info@fereidani.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/recaptcha2-1.1.2.tgz_1479250545974_0.6718947922345251"},"directories":{}},"1.3.2":{"name":"recaptcha2","version":"1.3.2","description":"Easy api for google reCAPTCHA version 2 for node.js and express.js","main":"index.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --compilers coffee:coffee-script/register --recursive tests","compile":"coffee -c --no-header index.coffee"},"repository":{"type":"git","url":"git+ssh://git@github.com/fereidani/recaptcha2.git"},"dependencies":{"request":"2.x"},"devDependencies":{"coffee-script":"^1.11.1","mocha":"^2.5.3","nock":"^8.0.0","should":"^11.1.0"},"keywords":["recaptcha","captcha","security","csrf","express"],"author":{"name":"Khashayar Fereidani"},"license":"MIT","bugs":{"url":"https://github.com/fereidani/recaptcha2/issues"},"homepage":"https://github.com/fereidani/recaptcha2#readme","contributors":[{"name":"Khashayar Fereidani","email":"info@fereidani.com"},{"name":"Dumitru Glavan","email":"contact@dumitruglavan.com"}],"gitHead":"604fab465f6939485c3b30ec082c1c8d1b996312","_id":"recaptcha2@1.3.2","_shasum":"892c4a5a4db25c63a7abe6fca857aadb706d84f8","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"fereidani","email":"info@fereidani.com"},"dist":{"shasum":"892c4a5a4db25c63a7abe6fca857aadb706d84f8","tarball":"https://registry.npmjs.org/recaptcha2/-/recaptcha2-1.3.2.tgz","integrity":"sha512-Jvo+YRVv0uYM2fKfIZ4VADdwa0oOfBnUSIhvQU9BVPNySo1GbtlECeoLhJFTQPeWsoe1skaJxvBSI2ttB3/nmA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6jTWP5WJr+BSQk3+Y3ZmAP33/RwL26+zaNMLdStFaXwIhAOJByUbKpdrohHWnc6wmYNEIsEVreQdzguaaR7sriVik"}]},"maintainers":[{"name":"fereidani","email":"info@fereidani.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/recaptcha2-1.3.2.tgz_1479250647301_0.5032592590432614"},"directories":{}},"1.3.3":{"name":"recaptcha2","version":"1.3.3","description":"Easy API for Google reCAPTCHA version 2 for Node.js and Express","main":"index.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --require coffeescript/register --recursive tests/*.coffee","compile":"coffee -c --no-header index.coffee"},"repository":{"type":"git","url":"git+ssh://git@github.com/fereidani/recaptcha2.git"},"dependencies":{"request":"2.x"},"devDependencies":{"coffeescript":"^2.3.2","mocha":"^5.2.0","nock":"^10.0.1","should":"^11.1.0"},"keywords":["recaptcha","captcha","security","csrf","express"],"author":{"name":"Khashayar Fereidani"},"license":"MIT","bugs":{"url":"https://github.com/fereidani/recaptcha2/issues"},"homepage":"https://github.com/fereidani/recaptcha2#readme","contributors":[{"name":"Khashayar Fereidani","email":"info@fereidani.com"},{"name":"Dumitru Glavan","email":"contact@dumitruglavan.com"}],"gitHead":"621d5956dd91a9d762b8e48c84ebecd5d80864d8","_id":"recaptcha2@1.3.3","_npmVersion":"6.4.1","_nodeVersion":"8.11.1","_npmUser":{"name":"fereidani","email":"info@fereidani.com"},"dist":{"integrity":"sha512-HgpvAmukTQW1UyZxM7PT/yLFayAN6rjTvYH13z/Ci69KfcOtv3BskRGBu7in+npzUG9XSxYAfRDtn6+p6p7tAw==","shasum":"50e24c9ce7cfe35bcc72e61c8a2c8e9a841ab73c","tarball":"https://registry.npmjs.org/recaptcha2/-/recaptcha2-1.3.3.tgz","fileCount":7,"unpackedSize":15431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1zG+CRA9TVsSAnZWagAAYIEP+wQy6YINiQLYfiR0Gb1f\n+GEOeJiNfLEkfAuyW4ptMOlyRakwxuveVNcfzh4Ga2pzLHGEkkS1fg6ZK3vT\nz+f95VDtDx2k3Nu5im9GVfDpkdHquKN8FgDoexEGLy4xTU7IHgoOM5bBn5XG\nqUyxsorjM1pozs/nUW/tYIDgTZ81nRp6IcI/D4CDrHqu1OVLS8t/53lbQkQm\n3dQ3sPVYEbq2edeNpfH2U8qxF3vNwaXOKQgvLXKov7nfBAR4JDQb/8yCXPt/\nZ09BFh+QjrOvT5j/2pHa5JYC3WMwt6N62Lvb3ZLW3roY4v6ahQ2KvlzqIs+V\nqQR59XVIgthjmPfgbaBxMyWgm1a+nejLSFawARlIsXlxe7tbuL06HVS4HfMX\ntWJyctUqeQP+6tsaP3pZBtR4DcgtOQnkKUXNY5s1cJY8M26o/gWArpxJ+li4\ngnMtziQCt4JCklm3MhwieU0nnRL2R6+kLI8eb59VtLM9eH3zCHZAcVP2yoWr\nH0wqy+f68aRTZgMhHe/Y4nC28JFFurKnya7tlS9MivmQ8wKHcBlEFxh0vRvZ\n6QEalkvRuAh9s/sbMDjXHoEGIJ1mtQPL99WbhdhQe0tulmZdpLWpg9oGlJTC\nL4JP/RP268pUt7WJ+CELBJK9TwdlTVNuR2tmArBEbqfgpbYKe2Bndq469Aqr\n5xDU\r\n=Q6c/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfx+iqjjJuICpzXz4YDezedeNn3c0WEJxjjs/eBgaRXAiEAn1cuj5Sodh56kAOocMYGEk8e0hsYC8e2fV7Aj4c7UoY="}]},"maintainers":[{"name":"fereidani","email":"info@fereidani.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/recaptcha2_1.3.3_1540829630229_0.09033855322422624"},"_hasShrinkwrap":false}},"homepage":"https://github.com/fereidani/recaptcha2#readme","keywords":["recaptcha","captcha","security","csrf","express"],"repository":{"type":"git","url":"git+ssh://git@github.com/fereidani/recaptcha2.git"},"author":{"name":"Khashayar Fereidani"},"bugs":{"url":"https://github.com/fereidani/recaptcha2/issues"},"license":"MIT","readmeFilename":"README.md","users":{"seachange":true,"alin.alexa":true,"colin-harrison":true,"iamninad":true},"contributors":[{"name":"Khashayar Fereidani","email":"info@fereidani.com"},{"name":"Dumitru Glavan","email":"contact@dumitruglavan.com"}]}