PHPackages                             pakpak/jwt-auth - 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. pakpak/jwt-auth

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

pakpak/jwt-auth
===============

Biblioteca PHP para a manipulação de JWT

2.1.4(5y ago)533MITPHPPHP ^7.3

Since Apr 13Pushed 5y ago2 watchersCompare

[ Source](https://github.com/AlpakaRosa/jwt-auth)[ Packagist](https://packagist.org/packages/pakpak/jwt-auth)[ RSS](/packages/pakpak-jwt-auth/feed)WikiDiscussions master Synced 5d ago

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

Jwt-Auth
========

[](#jwt-auth)

A PHP library for JWT manipulation using native PHP.

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

[](#installation)

Jwt-Auth is avaliable via Composer

```
"pakpak/jwt-auth": "^2.1.4"
```

or via terminal:

```
composer require pakpak/jwt-auth
```

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

[](#documentation)

- To use JwtAuth in your code

```
use PakPak\JwtAuth\JwtAuth;
```

- Creating a JWT:

```
use PakPak\JwtAuth\JwtAuth;
use PakPak\JwtAuth\JwtPayload;

$payload = new JwtPayload("localhost","user_id");
$key = "My-Secret-Key";

$jwtAuth = JwtAuth::createJwt($payload, $key);
```

- Creating a JWT from a token

```
use PakPak\JwtAuth\JwtAuth;

$jwtToken = "header.payload.sign";

$jwtAuth = JwtAuth::byJwt($jwtToken);
```

- Recovering data:

```
// - Validates the token created using the access key
$jwtAuth->verifyJwt("My-Secret-Key");

// - Returns a String containing the JWT Token
$jwtAuth->getJwt();

// - Returns an array containing the Header
$jwtAuth->getHeader();

// - Returns an array containing the Payload
$jwtAuth->getPayload();
```

- Creating a header using JwtFunctions:

```
use PakPak\JwtAuth\JwtFunctions;

$header = JwtFunctions::createHeader();
```

- Creating a Payload:

```
use PakPak\JwtAuth\JwtPayload;

//Token’s origin
$issuer = "www.meudominio.com";
//Token’s subject
$subject = "user_id";

$payload = new JwtPayload($issuer,$subject);
```

JwtException
------------

[](#jwtexception)

- Error codes:

CodeMessage1"Header cannot be empty"2"Payload cannot be empty"3"Secret Key cannot be empty"4"Sign cannot be empty"5"Invalid Token"

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~21 days

Total

6

Last Release

2118d ago

Major Versions

1.5.3 → 2.0.02020-06-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/ad15bc2d63ff9251c6fd4ba68ec6151ba53905b658a7743a0e97bab719ed6fc4?d=identicon)[Davi Lhlapak Rosa](/maintainers/Davi%20Lhlapak%20Rosa)

---

Top Contributors

[![DaviLhlapak](https://avatars.githubusercontent.com/u/50346240?v=4)](https://github.com/DaviLhlapak "DaviLhlapak (45 commits)")

---

Tags

composerhacktoberfestjwtjwt-authphp

### Embed Badge

![Health badge](/badges/pakpak-jwt-auth/health.svg)

```
[![Health](https://phpackages.com/badges/pakpak-jwt-auth/health.svg)](https://phpackages.com/packages/pakpak-jwt-auth)
```

###  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)
