auth-verify
v1.15.1
Published
A simple Node.js library for sending and verifying OTP via email, SMS and Telegram bot and performing it with queues and background jobs. And generating TOTP codes and QR codes. And handling JWT with Cookies. And also handling passwordless logins with pas
Maintainers
Readme
AuthVerify — Node.js Authentication Library
AuthVerify is a modular authentication library for Node.js, providing JWT, OTP, TOTP, Passkeys (WebAuthn), Magic Links, and OAuth helpers. You can easily register custom senders for OTPs or notifications.
🪄 Why Auth-Verify?
- ⚡ Simple API:
auth.register.sender()andauth.use('email') - 🧩 Multi-storage: memory, Redis, or cookie
- 🔑 JWT manager with auto cookie mode
- 📱 OTP via email, Telegram, SMS, WhatsApp Business API or custom sender (built-in workers for production level apps)
- 🔢 TOTP code and QR code generation and verification
- 🗝️ Passwordless login & registration with passkey/webauthn
- 💌 Magiclink for passwordless logins
- 🌎 Oauth 2.0 integration with providers
- 🧰 Extensible — add your own integrations easily
- 🔗 Frontend integration for creating QR codes of TOTP and verifying OTP codes and sending data for backend
🧭 Quick Start
npm install auth-verifyimport AuthVerify from "auth-verify";
const auth = new AuthVerify({ storeTokens: "memory" });
// Connecting sender
auth.otp.sender({
via: 'email',
sender: '[email protected]',
pass: 'YOUR_APP_PASS',
service: 'gmail'
});
(async () => {
let sent = await auth.otp.send('[email protected]');
if(sent) {
let valid = await auth.otp.verify('[email protected]', auth.otp.code);
if(valid) console.log('Correct OTP code');
else console.log('Incorrect OTP code');
}
})();
