PHPackages                             kiwfy/jwt-manager-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. kiwfy/jwt-manager-php

Abandoned → [not-empty/jwt-manager-php-lib](/?search=not-empty%2Fjwt-manager-php-lib)Library

kiwfy/jwt-manager-php
=====================

PHP library to manage JWT authentication

8.0.0(3mo ago)1412.9k↓100%1GPL-3.0-onlyPHPPHP ^8.4CI passing

Since Nov 3Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/not-empty/jwt-manager-php-lib)[ Packagist](https://packagist.org/packages/kiwfy/jwt-manager-php)[ RSS](/packages/kiwfy-jwt-manager-php/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (4)Versions (11)Used By (0)

JWT Manager PHP
===============

[](#jwt-manager-php)

[![Latest Version](https://camo.githubusercontent.com/494d4217ab980b2d76b0ff1faefea2da596a2e9c82438564d3eb09157a0eb056/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6e6f742d656d7074792f6a77742d6d616e616765722d7068702d6c69622e7376673f7374796c653d666c61742d737175617265)](https://github.com/not-empty/jwt-manager-php-lib/releases)[![codecov](https://camo.githubusercontent.com/3b786d1e526c1bffbf59bd2b26edc407b84b8a4e2cdaa194e8d88041f9560272/68747470733a2f2f636f6465636f762e696f2f67682f6e6f742d656d7074792f6a77742d6d616e616765722d7068702d6c69622f67726170682f62616467652e7376673f746f6b656e3d41454d56313633555736)](https://codecov.io/gh/not-empty/jwt-manager-php-lib)[![CI Build](https://camo.githubusercontent.com/20a0d3f2f25a4698fafa125cf01c020e8796ddcda6a497185b961b4d37a1eda8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e6f742d656d7074792f6a77742d6d616e616765722d7068702d6c69622f7068702e796d6c)](https://github.com/not-empty/jwt-manager-php-lib/actions/workflows/php.yml)[![Downloads Old](https://camo.githubusercontent.com/c9f90dce472fe508e56bb4775ff5b7adaa195c23cf1d4b6199347a3e2e0a9124/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b697766792f6a77742d6d616e616765722d7068703f6c6f676f3d6f6c64266c6162656c3d646f776e6c6f6164732532306c6567616379)](https://packagist.org/packages/kiwfy/jwt-manager-php)[![Downloads](https://camo.githubusercontent.com/5157d7ebf56d5c4ef4b218eb8fb9ccf1eaaeff20d3dec47b10f5311ac6d42d6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f742d656d7074792f6a77742d6d616e616765722d7068702d6c69623f6c6f676f3d6f6c64266c6162656c3d646f776e6c6f616473267632)](https://packagist.org/packages/not-empty/jwt-manager-php-lib)[![PRs Welcome](https://camo.githubusercontent.com/25b3e6d0d42c98de74a98cbb4d149a1c09020cf6d1361993b72d7d5b8ffed363/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://makeapullrequest.com)[![Packagist License (custom server)](https://camo.githubusercontent.com/a47cab5f16a0a9ecbc20766d9ffda65b4b56b8bfb072c79aea11309887c6d5eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e6f742d656d7074792f6a77742d6d616e616765722d7068702d6c69623f7632)](https://github.com/not-empty/jwt-manager-php-lib/blob/master/LICENSE)

PHP library to manage JWT authentication

### Installation

[](#installation)

[Release 8.0.0](https://github.com/not-empty/jwt-manager-php-lib/releases/tag/8.0.0) Requires [PHP](https://php.net) 8.4

[Release 7.0.0](https://github.com/not-empty/jwt-manager-php-lib/releases/tag/7.0.0) Requires [PHP](https://php.net) 8.3

[Release 6.0.0](https://github.com/not-empty/jwt-manager-php-lib/releases/tag/6.0.0) Requires [PHP](https://php.net) 8.2

[Release 5.0.0](https://github.com/not-empty/jwt-manager-php-lib/releases/tag/5.0.0) Requires [PHP](https://php.net) 8.1

[Release 4.0.0](https://github.com/not-empty/jwt-manager-php-lib/releases/tag/4.0.0) Requires [PHP](https://php.net) 7.4

[Release 3.0.0](https://github.com/not-empty/jwt-manager-php-lib/releases/tag/3.0.0) Requires [PHP](https://php.net) 7.3

[Release 2.0.0](https://github.com/not-empty/jwt-manager-php-lib/releases/tag/2.0.0) Requires [PHP](https://php.net) 7.2

[Release 1.0.0](https://github.com/not-empty/jwt-manager-php-lib/releases/tag/1.0.0) Requires [PHP](https://php.net) 7.1

The recommended way to install is through [Composer](https://getcomposer.org/).

```
composer require not-empty/jwt-manager-php-lib
```

### Usage

[](#usage)

Generating a token

```
use JwtManager\JwtManager;
$secret = '77682b9441bb7daa7a1fa6eb7522b689';
$context = 'test';
$expire = 30;
$renew = 10;
$jwtManager = new JwtManager(
    $secret,
    $context,
    $expire,
    $renew
);
$tokenGenerated = $jwtManager->generate('test');
var_dump($tokenGenerated);
```

Dedoce the token and return the data

```
$result = $jwtManager->decodePayload($tokenGenerated);
var_dump($result);
```

Verify if token is valid

```
$result = $jwtManager->isValid($tokenGenerated);
var_dump($result);
```

Check if a token is on time

```
$result = $jwtManager->isOnTime($tokenGenerated);
var_dump($result);
```

Get the expiration time of a token

```
$result = $jwtManager->getexpire($tokenGenerated);
var_dump($result);
```

Check if need to refresh a token

```
$result = $jwtManager->tokenNeedToRefresh($tokenGenerated);
var_dump($result);
```

if you want an environment to run or test it, you can build and install dependences like this

```
docker build --build-arg PHP_VERSION=8.4-cli -t not-empty/jwt-manager-php-lib:php84 -f contrib/Dockerfile .
```

Access the container

```
docker run --name jwt-manager-php-lib -v ${PWD}/:/var/www/html -it not-empty/jwt-manager-php-lib:php84 bash
```

Verify if all dependencies is installed

```
composer install --no-dev --prefer-dist
```

and run

```
php sample/jwt-manager-sample.php
```

### Development

[](#development)

Want to contribute? Great!

The project using a simple code. Make a change in your file and be careful with your updates! **Any new code will only be accepted with all validations.**

To ensure that the entire project is fine:

First you need to building a correct environment to install all dependences

```
docker build --build-arg PHP_VERSION=8.4-cli -t not-empty/jwt-manager-php-lib:php84 -f contrib/Dockerfile .
```

Access the container

```
docker run --name jwt-manager-php-lib -v ${PWD}/:/var/www/html -it not-empty/jwt-manager-php-lib:php84 bash
```

Install all dependences

```
composer install --prefer-dist
```

Run all validations

```
composer check
```

**Not Empty Foundation - Free codes, full minds**

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance82

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 70% 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 ~97 days

Recently: every ~193 days

Total

9

Last Release

95d ago

Major Versions

3.0.0 → 4.0.02023-11-03

4.0.0 → 5.0.02023-11-03

5.0.0 → 6.0.02023-11-03

6.0.0 → 7.0.02023-11-27

7.0.1 → 8.0.02025-12-17

PHP version history (8 changes)1.0.0PHP ^7.1

2.0.0PHP ^7.2

3.0.0PHP ^7.3

4.0.0PHP ^7.4

5.0.0PHP ^8.1

6.0.0PHP ^8.2

7.0.0PHP ^8.3

8.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a8e537dba9018eff457d477dba8f79158989b41ca86bd74d1c4a1186c158caa?d=identicon)[kiwfy](/maintainers/kiwfy)

---

Top Contributors

[![leodisarli](https://avatars.githubusercontent.com/u/1638455?v=4)](https://github.com/leodisarli "leodisarli (14 commits)")[![espositovitor](https://avatars.githubusercontent.com/u/26362498?v=4)](https://github.com/espositovitor "espositovitor (4 commits)")[![brunavitoria](https://avatars.githubusercontent.com/u/43785466?v=4)](https://github.com/brunavitoria "brunavitoria (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kiwfy-jwt-manager-php/health.svg)

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

PHPackages © 2026

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