PHPackages                             2amigos/2fa-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. 2amigos/2fa-library

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

2amigos/2fa-library
===================

2 Factor Authentication (2FA) library

3.0.0(2y ago)34367.1k↓20.1%10[3 PRs](https://github.com/2amigos/2fa-library/pulls)7BSD-3-ClausePHPPHP &gt;=7.4

Since Aug 28Pushed 2y ago3 watchersCompare

[ Source](https://github.com/2amigos/2fa-library)[ Packagist](https://packagist.org/packages/2amigos/2fa-library)[ Docs](http://www.2amigos.us/open-source/details/twofa-library)[ RSS](/packages/2amigos-2fa-library/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (10)Used By (7)

2fa library
===========

[](#2fa-library)

[![tests](https://github.com/2amigos/2fa-library/actions/workflows/ci.yml/badge.svg)](https://github.com/2amigos/2fa-library/actions/workflows/ci.yml)[![Latest Version](https://camo.githubusercontent.com/e389f150528410e7348f7b2db68e889ac08eb2c7edce3b38f09b17c1aea8605c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f32616d69676f732f3266612d6c6962726172792e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://github.com/2amigos/2fa-library/tags)[![Software License](https://camo.githubusercontent.com/b60331a2084501dc07cf6d6964c0da58dd005d89c45cf3b28b4b22b60f5ec00f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This library allows developers to implement Time Based One Time Passwords (TOTP) for the PHP implementation of the 2factor Authentication (2FA), supporting both the HMAC-based one-time password (HOTP) and the time-based one-time passwords (TOTP).

Documentation
-------------

[](#documentation)

You can read the latest docs on

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Antonio Ribeiro Google 2FA](https://github.com/antonioribeiro/google2fa)
- [Antonio Ramirez](https://github.com/tonydspaniard)
- [All Contributors](../../contributors)

License
-------

[](#license)

The BSD License (BSD). Please see [License File](LICENSE.md) for more information.

> [![2amigOS!](https://camo.githubusercontent.com/9fd8f1de41dc23003bb2a54034cb6658dde5be97092e195a62d629d0d7fa7f6c/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f35353336333339346437323934356666376564333132353536656330343165302e706e67)](http://www.2amigos.us)

*Web development has never been so fun!*
[www.2amigos.us](http://www.2amigos.us)

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~292 days

Recently: every ~578 days

Total

9

Last Release

849d ago

Major Versions

1.0.3 → 2.0.02020-01-31

2.0.2 → 3.0.02024-01-20

PHP version history (3 changes)1.0.0-betaPHP &gt;=5.6

2.0.0PHP &gt;=7.3

3.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/566016?v=4)[Antonio Ramirez](/maintainers/tonydspaniard)[@tonydspaniard](https://github.com/tonydspaniard)

---

Top Contributors

[![2amjsouza](https://avatars.githubusercontent.com/u/142612126?v=4)](https://github.com/2amjsouza "2amjsouza (10 commits)")[![tonydspaniard](https://avatars.githubusercontent.com/u/566016?v=4)](https://github.com/tonydspaniard "tonydspaniard (5 commits)")

---

Tags

2amigos2faauthenticationlibraryphptwo-factorphphotptotplibrary2faextensionauthenticator2amigos

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/2amigos-2fa-library/health.svg)

```
[![Health](https://phpackages.com/badges/2amigos-2fa-library/health.svg)](https://phpackages.com/packages/2amigos-2fa-library)
```

###  Alternatives

[chillerlan/php-authenticator

A generator for counter- and time based 2-factor authentication codes (Google Authenticator). PHP 8.2+

58119.1k2](/packages/chillerlan-php-authenticator)[paragonie/multi-factor

Vendor-agnostic two-factor authentication library

142195.5k2](/packages/paragonie-multi-factor)[jiripudil/otp

Library that generates and verifies one-time passwords.

2825.4k1](/packages/jiripudil-otp)[kelunik/two-factor

Two factor authentication.

371.9k1](/packages/kelunik-two-factor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
