otplibOne-Time Password Library
TypeScript-first library for HOTP and TOTP authentication with multi-runtime support and pluggable architecture
TypeScript-first library for HOTP and TOTP authentication with multi-runtime support and pluggable architecture
Built with modern practices
Written in TypeScript with complete type definitions. Async-first API design with synchronous alternatives.
Swap crypto and Base32 implementations via plugins. Use Web Crypto, Node crypto, or bring your own.
Full implementation of RFC 4226 (HOTP) and RFC 6238 (TOTP) specifications.
Compatible with common authenticator apps like Google, Microsoft, Authy and many more.
See it in action
Time-based tokens that refresh every 30 seconds. The standard for authenticator apps.
Counter-based tokens that increment with each use. Ideal for hardware tokens.