{"_id":"2fa-plus","_rev":"1-8c6440582f4f88bc7a028fea4c35c0b3","name":"2fa-plus","description":"Implementation of two-factor authentication in Node, made simple.","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"2fa-plus","version":"1.0.0","keywords":["auth","2fa","mfa","token","key","base32","code","generator","totp","notp"],"author":{"name":"Aaron Duce","email":"aaron@duce.me.uk"},"license":"Apache-2.0","_id":"2fa-plus@1.0.0","maintainers":[{"name":"aaronduce","email":"aaron@duce.me.uk"}],"contributors":[{"name":"Aaron Duce","email":"aaron@duce.me.uk"}],"homepage":"https://github.com/aaronduce/2fa-plus#readme","bugs":{"url":"https://github.com/aaronduce/2fa-plus/issues"},"dist":{"shasum":"f64d61279f3ca47fa952074872d9da2869e155f6","tarball":"https://registry.npmjs.org/2fa-plus/-/2fa-plus-1.0.0.tgz","fileCount":9,"integrity":"sha512-41Nw6e64Xruv3z5uAjumYwABjqSEiks2xhzAf7L/B36CsC8CFuBL8mSX86h38jTt8Yf/jeVIV/YMtxlKeEwC0w==","signatures":[{"sig":"MEUCIEVU/vEgAy3Uv4ZXRm6f3dCkREXEx6egHsogowjxTgtIAiEAwoNPdh/WmmQql0I7knu4UvzzT3BpK3kFnMr+VyiX3Ec=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27804},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"8cd3ec3ec823635670923d4d3b2f0f30a7ed498d","private":false,"scripts":{"test":"jest","build":"tsup"},"_npmUser":{"name":"aaronduce","email":"aaron@duce.me.uk"},"repository":{"url":"git+https://github.com/aaronduce/2fa-plus.git","type":"git"},"_npmVersion":"10.5.0","description":"Implementation of two-factor authentication in Node, made simple.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"notp":"^2.0.3","tslib":"^2.6.2","qrcode":"^1.5.3","thirty-two":"^1.0.2","@types/notp":"^2.0.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.0.2","ts-jest":"^29.1.4","ts-node":"^10.9.2","typescript":"^5.4.5","@types/jest":"^29.5.12","@types/node":"^20.12.12"},"_npmOperationalInternal":{"tmp":"tmp/2fa-plus_1.0.0_1716994503221_0.7378444564733024","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"2fa-plus","version":"1.0.1","description":"Implementation of two-factor authentication in Node, made simple.","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","private":false,"scripts":{"build":"tsup","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/aaronduce/2fa-plus.git"},"keywords":["auth","2fa","mfa","token","key","base32","code","generator","totp","notp"],"author":{"name":"Aaron Duce","email":"aaron@duce.me.uk"},"contributors":[{"name":"Aaron Duce","email":"aaron@duce.me.uk"}],"license":"Apache-2.0","homepage":"https://github.com/aaronduce/2fa-plus#readme","dependencies":{"@types/notp":"^2.0.5","notp":"^2.0.3","qrcode":"^1.5.3","thirty-two":"^1.0.2","tslib":"^2.6.2"},"devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.12.12","jest":"^29.7.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","tsup":"^8.0.2","typescript":"^5.4.5"},"_id":"2fa-plus@1.0.1","gitHead":"c22b94982a77e59188ff50c7cc8597fa6465326d","bugs":{"url":"https://github.com/aaronduce/2fa-plus/issues"},"_nodeVersion":"18.20.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-lt+IUS+iJNcIdWhEF5QmkA/TIqPx3ClbGgh5Zvt9QZOKi9kwKjCPGHpjdVDF1TVxQ3IhfZERg3mUN6E8UFYNPQ==","shasum":"87159dd96b7b135f47393bd58275b71b15e020dd","tarball":"https://registry.npmjs.org/2fa-plus/-/2fa-plus-1.0.1.tgz","fileCount":9,"unpackedSize":28267,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBDqvoIfqloGOuPYOfmsO1hF03cXZdcCei0x2mSf2D0JAiAEVcxjZxcqzJK4yoBDuGIj71BdA6z3J9UWoXsCqwqtXA=="}]},"_npmUser":{"name":"aaronduce","email":"aaron@duce.me.uk"},"directories":{},"maintainers":[{"name":"aaronduce","email":"aaron@duce.me.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2fa-plus_1.0.1_1716995402553_0.29361674012370287"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-29T14:55:03.221Z","modified":"2024-05-29T15:10:03.115Z","1.0.0":"2024-05-29T14:55:03.411Z","1.0.1":"2024-05-29T15:10:02.881Z"},"maintainers":[{"name":"aaronduce","email":"aaron@duce.me.uk"}],"author":{"name":"Aaron Duce","email":"aaron@duce.me.uk"},"repository":{"type":"git","url":"git+https://github.com/aaronduce/2fa-plus.git"},"keywords":["auth","2fa","mfa","token","key","base32","code","generator","totp","notp"],"license":"Apache-2.0","homepage":"https://github.com/aaronduce/2fa-plus#readme","bugs":{"url":"https://github.com/aaronduce/2fa-plus/issues"},"readme":"# 2fa-plus\n\nImplementation of two-factor authentication in Node, made simple.\n\nCredit for original implementation on which this has been abstracted from goes to [node-2fa](https://github.com/jeremyscalpello/node-2fa) - Jeremy Scalpello.\n\nThis has been reworked from the ground up to:\n- Not be reliant on Google Charts for QR code generation, and instead return a base64-png image.\n- Full typescript support.\n\n---\n\nThere are a number of applications which support 2-Factor Authentication, namely\n\n- Authy [iPhone](https://itunes.apple.com/us/app/authy/id494168017?mt=8) | [Android](https://play.google.com/store/apps/details?id=com.authy.authy&hl=en) | [Chrome](https://chrome.google.com/webstore/detail/authy/gaedmjdfmmahhbjefcbgaolhhanlaolb?hl=en) | [Linux](https://www.authy.com/personal/) | [OS X](https://www.authy.com/personal/) \n- Google Authenticator [iPhone](https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8) | [Android](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en)\n- Microsoft Authenticator [iPhone](https://apps.apple.com/gb/app/microsoft-authenticator/id983156458) | [Android](https://play.google.com/store/apps/details?id=com.microsoft.msa.authenticator)\n\nThis module uses [`notp`](https://github.com/guyht/notp) which implements `TOTP` [(RFC 6238)](https://www.ietf.org/rfc/rfc6238.txt)\n(the _Authenticator_ standard), which is based on `HOTP` [(RFC 4226)](https://www.ietf.org/rfc/rfc4226.txt)\nto provide codes that are exactly compatible with all other _Authenticator_ apps and services that use them.\n\nUsage\n=====\n\n```bash\nnpm install 2fa-plus --save\n```\n\n### Generate a new secret\n\n```ts\nimport { generateSecret } from \"2fa-plus\";\n\nconst secret = generateSecret('Name', 'account@demo.com');\n\n// output: { secret, uri, qr }\n```\n\n### Generate a token from a secret\n\n```ts\nimport { generateToken } from \"2fa-plus\";\n\nconst token = generateToken(secret.secret);\n\n// output: token\n```\n\n### Verify a token\n\n```ts\nimport { verifyToken } from \"2fa-plus\";\n\nconst isValid = verifyToken(secret, token);\n\n// output: true/false\n```","readmeFilename":"README.md","contributors":[{"name":"Aaron Duce","email":"aaron@duce.me.uk"}]}