PHPackages                             authy/php - 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. authy/php

Abandoned → [twilio/sdk](/?search=twilio%2Fsdk)ArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

authy/php
=========

PHP client for Authy

3.0.5(7y ago)2483.9M—8.3%855MITPHPPHP &gt;=5.6.0

Since Aug 14Pushed 3y ago20 watchersCompare

[ Source](https://github.com/twilio/authy-php)[ Packagist](https://packagist.org/packages/authy/php)[ Docs](https://github.com/authy/authy-php)[ RSS](/packages/authy-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (16)Used By (5)

[![Packagist version](https://camo.githubusercontent.com/0ccb7b87a86741a8c1ccbf94ecb357f00c8a95ebd5357243103d22e11b1a2fa2/68747470733a2f2f62616467652e667572792e696f2f70682f61757468792532467068702e737667)](https://packagist.org/packages/authy/php) [![Build Status](https://camo.githubusercontent.com/626bf9318d051af584c849edbac5d75dee023e7056142e71e1f8d29d57f9c320/68747470733a2f2f7472617669732d63692e6f72672f7477696c696f2f61757468792d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/twilio/authy-php)

🚨🚨🚨

**This library is no longer actively maintained.** The Authy API has been replaced with the [Twilio Verify API](https://www.twilio.com/docs/verify). Twilio will support the Authy API through November 1, 2022 for SMS/Voice. After this date, we’ll start to deprecate the service for SMS/Voice. Any requests sent to the API after May 1, 2023, will automatically receive an error. Push and TOTP will continue to be supported through July 2023.

[Learn more about migrating from Authy to Verify.](https://www.twilio.com/blog/migrate-authy-to-verify)

Please visit the Twilio Docs for:

- [Verify + PHP (Laravel) quickstart](https://www.twilio.com/docs/verify/quickstarts/php-laravel)
- [Twilio PHP helper library](https://www.twilio.com/docs/libraries/php)
- [Verify API reference](https://www.twilio.com/docs/verify/api)

Please direct any questions to [Twilio Support](https://support.twilio.com/hc/en-us). Thank you!

🚨🚨🚨

PHP Client for Twilio Authy Two-Factor Authentication (2FA) API
---------------------------------------------------------------

[](#php-client-for-twilio-authy-two-factor-authentication-2fa-api)

Documentation for PHP usage of the Authy API lives in the [official Twilio documentation](https://www.twilio.com/docs/authy/api/).

The Authy API supports multiple channels of 2FA:

- One-time passwords via SMS and voice.
- Soft token ([TOTP](https://www.twilio.com/docs/glossary/totp) via the Authy App)
- Push authentication via the Authy App

If you only need SMS and Voice support for one-time passwords, we recommend using the [Twilio Verify API](https://www.twilio.com/docs/verify/api) instead. [More on how to choose between Authy and Verify here.](https://www.twilio.com/docs/verify/authy-vs-verify)

### Authy Quickstart

[](#authy-quickstart)

For a full tutorial, check out the PHP/Laravel Authy Quickstarts in our docs:

- [PHP/Laravel Authy Quickstart](https://www.twilio.com/docs/authy/quickstart/two-factor-authentication-php-laravel)

Authy PHP Installation
----------------------

[](#authy-php-installation)

This library requires PHP 5.6+

Install with [composer](https://www.twilio.com/docs/usage/tutorials/how-to-set-up-your-php-development-environment). The [`authy/php`](http://packagist.org/packages/authy/php) package is available on [Packagist](https://packagist.org/packages/authy/php).

Include in your `composer.json` as follows:

```
{
    "require": {
        "authy/php": "3.0.5"
    }
}

```

Usage
-----

[](#usage)

To use the Authy client, import AuthyApiClient and initialize it with your production API Key found in the [Twilio Console](https://www.twilio.com/console/authy/applications/):

```
$authy_api = new Authy\AuthyApi('#your_api_key');
```

[![authy api key in console](https://camo.githubusercontent.com/084c30e53650b9ef69f70cdf03671102075dd26bd2d828a8cef0e094eac312b5/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f636f6d2e7477696c696f2e70726f642e7477696c696f2d646f63732f696d616765732f6163636f756e742d73656375726974792d6170692d6b65792e77696474682d3830302e706e67)](https://camo.githubusercontent.com/084c30e53650b9ef69f70cdf03671102075dd26bd2d828a8cef0e094eac312b5/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f636f6d2e7477696c696f2e70726f642e7477696c696f2d646f63732f696d616765732f6163636f756e742d73656375726974792d6170692d6b65792e77696474682d3830302e706e67)

2FA Workflow
------------

[](#2fa-workflow)

1. [Create a user](https://www.twilio.com/docs/authy/api/users#enabling-new-user)
2. [Send a one-time password](https://www.twilio.com/docs/authy/api/one-time-passwords)
3. [Verify a one-time password](https://www.twilio.com/docs/authy/api/one-time-passwords#verify-a-one-time-password)

**OR**

1. [Create a user](https://www.twilio.com/docs/authy/api/users#enabling-new-user)
2. [Send a push authentication](https://www.twilio.com/docs/authy/api/push-authentications)
3. [Check a push authentication status](https://www.twilio.com/docs/authy/api/push-authentications#check-approval-request-status)

Phone Verification
----------------------------------------------------------------

[](#phone-verification)

[Phone verification now lives in the Twilio API](https://www.twilio.com/docs/verify/api) and has [PHP support through the official Twilio helper libraries](https://www.twilio.com/docs/libraries/php).

[Legacy (V1) documentation here.](verify-legacy-v1.md) **Verify V1 is not recommended for new development. Please consider using [Verify V2](https://www.twilio.com/docs/verify/api)**.

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

[](#contributing)

You can use docker to run tests and develop locally without the need to install the dependencies directly in your machine:

```
git clone git@github.com:authy/authy-php.git
cd authy-php
make docker-build # Creates the docker image
make docker-deps  # Install dependencies (in the `vendor` directory)
make docker-test  # Runs the tests

```

To contribute, make your changes in a branch and send a Pull Request to the twilio/authy-php repo.

Copyright
---------

[](#copyright)

Copyright (c) 2011-2020 Authy Inc. See [LICENSE](https://github.com/twilio/authy-php/blob/master/LICENSE) for further details.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity62

Solid adoption and visibility

Community36

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~218 days

Recently: every ~230 days

Total

12

Last Release

1890d ago

Major Versions

v2.5 → v3.02018-01-02

3.0.5 → 4.0.0-rc12020-10-10

PHP version history (4 changes)v2.0PHP &gt;=5.3.0

v3.0PHP &gt;=5.6.0

4.0.0-rc1PHP ^7.2.5

4.0.0-rc2PHP ^7.2.5||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/33c6592aec3bdb11a5d024761c6e0723ebd24baab66c0ba03e73c5e16095f35a?d=identicon)[robinske](/maintainers/robinske)

![](https://www.gravatar.com/avatar/398d3de0d5ea4ba1bde37f7138185e36ac62417033dfc0af87b431957ec2170e?d=identicon)[svc.twilio-authy-api](/maintainers/svc.twilio-authy-api)

---

Top Contributors

[![dcu](https://avatars.githubusercontent.com/u/73729?v=4)](https://github.com/dcu "dcu (29 commits)")[![serargz](https://avatars.githubusercontent.com/u/2054553?v=4)](https://github.com/serargz "serargz (17 commits)")[![robinske](https://avatars.githubusercontent.com/u/3673341?v=4)](https://github.com/robinske "robinske (13 commits)")[![4cm3](https://avatars.githubusercontent.com/u/66889641?v=4)](https://github.com/4cm3 "4cm3 (9 commits)")[![vargasx](https://avatars.githubusercontent.com/u/15661037?v=4)](https://github.com/vargasx "vargasx (3 commits)")[![chrisdeeming](https://avatars.githubusercontent.com/u/2158514?v=4)](https://github.com/chrisdeeming "chrisdeeming (2 commits)")[![GiamPy5](https://avatars.githubusercontent.com/u/4460702?v=4)](https://github.com/GiamPy5 "GiamPy5 (2 commits)")[![senekis](https://avatars.githubusercontent.com/u/189874?v=4)](https://github.com/senekis "senekis (2 commits)")[![merlin-bud](https://avatars.githubusercontent.com/u/45758290?v=4)](https://github.com/merlin-bud "merlin-bud (2 commits)")[![zQueal](https://avatars.githubusercontent.com/u/239193?v=4)](https://github.com/zQueal "zQueal (1 commits)")[![castis](https://avatars.githubusercontent.com/u/67277?v=4)](https://github.com/castis "castis (1 commits)")[![cmodijk](https://avatars.githubusercontent.com/u/771041?v=4)](https://github.com/cmodijk "cmodijk (1 commits)")[![enygma](https://avatars.githubusercontent.com/u/66796?v=4)](https://github.com/enygma "enygma (1 commits)")[![goodeath](https://avatars.githubusercontent.com/u/26310730?v=4)](https://github.com/goodeath "goodeath (1 commits)")[![luisuribe](https://avatars.githubusercontent.com/u/148514?v=4)](https://github.com/luisuribe "luisuribe (1 commits)")[![rotorsolutions](https://avatars.githubusercontent.com/u/9609046?v=4)](https://github.com/rotorsolutions "rotorsolutions (1 commits)")[![tufla](https://avatars.githubusercontent.com/u/996559?v=4)](https://github.com/tufla "tufla (1 commits)")

---

Tags

apiAuthenticationtwo-factor

### Embed Badge

![Health badge](/badges/authy-php/health.svg)

```
[![Health](https://phpackages.com/badges/authy-php/health.svg)](https://phpackages.com/packages/authy-php)
```

###  Alternatives

[srmklive/authy

Plugin for enabling two-factor authentication in Laravel applications

6741.3k](/packages/srmklive-authy)[chervand/yii2-oauth2-server

OAuth 2.0 server for Yii 2.0 with MAC tokens support.

1524.2k1](/packages/chervand-yii2-oauth2-server)[benbjurstrom/cognito-jwt-guard

A laravel auth guard for JSON Web Tokens issued by Amazon AWS Cognito

1113.1k](/packages/benbjurstrom-cognito-jwt-guard)

PHPackages © 2026

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