PHPackages                             jeichorn/g-authify-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. jeichorn/g-authify-php

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

jeichorn/g-authify-php
======================

GAuthify PHP Client Library

v2.0.1(10y ago)021.8k↑2900%MITPHP

Since Oct 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jeichorn/GAuthify-PHP)[ Packagist](https://packagist.org/packages/jeichorn/g-authify-php)[ RSS](/packages/jeichorn-g-authify-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

GAuthify-PHP
============

[](#gauthify-php)

[Direct link to library](https://github.com/jeichorn/GAuthify-PHP).

This is the PHP API Client for [GAuthify](https://www.gauthify.com). The GAuthify REST api helps websites quickly add multi-factor authentication through Google Authenticator, SMS, and Email. This package is a simple wrapper around that api.

It has been forked by Joshua Eichorn @Pagely() to be namespaced and installable with composer

Installation
------------

[](#installation)

Install using composer

```
composer require jeichorn/g-authify-php

```

Include vendor/autoload.php, and use the class

```
include 'vendor/autoload.php';
use GAuthify\GAuthify;

```

To run a quick test to make sure everything works fine run:

```
include 'vendor/autoload.php';
use GAuthify\GAuthify;
$gauthify = new GAuthify();
$gauthify->quick_test((optional), (optional));

```

Usage
-----

[](#usage)

\####Initiate:#### First get an API key by signing up for an account [here](http://www.gauthify.com).

First instantiate a GAuthify object:

```
include 'vendor/autoload.php';
use GAuthify\GAuthify;
$auth_instance = new GAuthify();

```

\####Create User:####

```
auth_instance->create_user(, ,  *optional,  *optional,  *optional)

```

- unique\_id: An id to identify user. Could be the PK used for the user in your db.
- display\_name: Name that will be displayed on the library
- email: A valid email
- sms\_number: A valid mobile phone number for sms (Currently US only!)
- voice\_number: A valid phone number for calls (Currently US only!)
- meta: A dictionary of key/value pairs to be added to meta data
- Returns: The user hash or raises Error

The user hash returned will have parameters outlined on the GAuthify.com dashboard page. You can show the user the QR code to scan in their google authenticator applicatoin or you can link/iframe the instructions url.

\####Update User:####

```
auth_instance->update_user(,  *optional,  *optional,  *optional,  *optional)

```

- unique\_id: An id to identify user. Could be the PK used for the user in your db.
- display\_name: Name that will be displayed on the library
- email: A valid email
- sms\_number: A valid mobile phone number for sms (Currently US only!)
- voice\_number: A valid phone number for calls (Currently US only!)
- meta: A dictionary of key/value pairs to be added to meta data
- reset\_key: If set to any in \['true' ,'t', '1'\] the Google Authenticator secret key will be reset to a new one.
- Returns: The updated user hash or raises Error

\####Delete User:####

```
auth_instance->delete_user()

```

- unique\_id: An id to identify user. Could be the PK used for the user in your db.
- Returns: True or raises Error

\####Get All Users:####

```
auth_instance->get_all_users()

```

- Returns: List of user hashes

\####Get User:####

```
auth_instance->get_user()

```

- unique\_id: An id to identify user. Could be the PK used for the user in your db.
- Returns: User hash or raises Error

\####Get User By Token:####

```
auth_instance->get_user_by_token()

```

- token: A 35 char token that starts with gat given by ezGAuth.
- Returns: User hash or raises Error

\####Check Auth Code:####

```
auth_instance->check_auth(, , safe_mode = False)

```

- unique\_id: An id to identify user. Could be the PK used for the user in your db.
- auth\_code: Code retrieved from Google Authenticator, SMS, EMail, or OTP
- safe\_mode: If set to true, all exceptions during the request will be suppressed and the check will return True. This essentially temporary bypasses 2-factor authentication if there is a unusual server error.
- Return: True/False (bool) or raises Error

\####Send Email:####

```
auth_instance->send_email(,  *optional)

```

- unique\_id: An id to identify user. Could be the PK used for the user in your db.
- email: A valid email
- Returns: User hash or raises Error

\####Send SMS:####

```
auth_instance->send_sms(,  *optional)

```

- unique\_id: An id to identify user. Could be the PK used for the user in your db.
- sms\_number: A valid us phone number for sms(Currently US only!)
- Returns: User hash or raises Error

\####Send Voice:####

```
auth_instance->send_voice(,  *optional)

```

- unique\_id: An id to identify user. Could be the PK used for the user in your db.
- voice\_number: A valid us phone number for phone calls(Currently US only!)
- Returns: User hash or raises Error

Errors
------

[](#errors)

Up to-date json formatted errors can be grabbed from the server using:

```
auth_instance->api_errors()

```

They should rarely change and will be backward compatible.

The primary error class is GAuthifyError, it can be used as follows:

```
use GAuthify\GAuthifyError;

try{

}
catch (GAuthifyError $e){
    print(e->msg) # The error message
    print(e->http_status) # The http status code
    print(e->error_code) # A error code listed in the GAuthfiy application
    print(e->response_body) # The raw http response
}

```

The following errors extend GAuthifyError:

- ApiKeyError - Wraps 401 responses (api key issues)
- RateLimitError - Wraps 402 responses (Plan limits, etc)
- ParameterError - Wraps 406 response (Bad formatted unique\_id, sms, phone number ,etc)
- NotFoundError - Wraps 404 error (requesting a unique\_id that doesnt exist)
- ConflictError - Wraps 409 error for existing resources.
- ServerError - Wraps 500 and other server errors

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~0 days

Total

2

Last Release

3856d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/51c9f0299b163ebf9be813ce0f81ae99a7b093144a42409dd3067c500319522e?d=identicon)[jeichorn](/maintainers/jeichorn)

---

Top Contributors

[![pnegahdar](https://avatars.githubusercontent.com/u/833067?v=4)](https://github.com/pnegahdar "pnegahdar (16 commits)")[![jeichorn](https://avatars.githubusercontent.com/u/122486?v=4)](https://github.com/jeichorn "jeichorn (4 commits)")

### Embed Badge

![Health badge](/badges/jeichorn-g-authify-php/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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