PHPackages                             dmstr/yii2-token-manager - 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. dmstr/yii2-token-manager

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

dmstr/yii2-token-manager
========================

A token manager for jwt tokens

2.0.2(1y ago)411.2k↑23.1%1MITPHP

Since Dec 21Pushed 1y ago4 watchersCompare

[ Source](https://github.com/dmstr/yii2-token-manager)[ Packagist](https://packagist.org/packages/dmstr/yii2-token-manager)[ RSS](/packages/dmstr-yii2-token-manager/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (9)Dependencies (2)Versions (18)Used By (0)

Token Manager
=============

[](#token-manager)

A token manager for jwt tokens

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require dmstr/yii2-token-manager

```

or add

```
"dmstr/yii2-token-manager": "dev-master"

```

to the require section of your `composer.json` file.

Configuration
-------------

[](#configuration)

Add the component to your config

```
use dmstr\tokenManager\components\TokenManager;

return [
    'components' => [
        'tokenManager' => [
            'class' => TokenManager::class
        ]
    ]
];
```

Usage
-----

[](#usage)

Once the extension is installed and configurated, simply use it in your code by:

For more infos about Yii2 and JWT check out [lcobucci/jwt](https://github.com/lcobucci/jwt)

```
use dmstr\tokenManager\exceptions\LoadTokenException;

$token = ...; // valid Jwt token

Yii::$app->tokenManager->setToken($token);

try {
    $roles = Yii::$app->tokenManager->getRoles();
} catch (LoadTokenException $exception) {
 // ...
}
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance45

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.8% 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 ~61 days

Recently: every ~142 days

Total

15

Last Release

432d ago

Major Versions

1.4.0 → 2.0.02024-01-26

### Community

Maintainers

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

---

Top Contributors

[![eluhr](https://avatars.githubusercontent.com/u/13000805?v=4)](https://github.com/eluhr "eluhr (17 commits)")[![a-klapper](https://avatars.githubusercontent.com/u/54941040?v=4)](https://github.com/a-klapper "a-klapper (13 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (1 commits)")

---

Tags

jwtyii2extension

### Embed Badge

![Health badge](/badges/dmstr-yii2-token-manager/health.svg)

```
[![Health](https://phpackages.com/badges/dmstr-yii2-token-manager/health.svg)](https://phpackages.com/packages/dmstr-yii2-token-manager)
```

###  Alternatives

[sizeg/yii2-jwt

JWT based on Icobucci

1951.1M7](/packages/sizeg-yii2-jwt)[bizley/jwt

JWT integration for Yii 2

69478.8k2](/packages/bizley-jwt)[kakadu-dev/yii2-jwt-auth

Extension provide JWT auth for Yii2

105.8k](/packages/kakadu-dev-yii2-jwt-auth)

PHPackages © 2026

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