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

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

june/jwt
========

JWT Singleton encapsulation

1.0.1(2y ago)015MITPHPPHP &gt;=7.4

Since Jul 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/JuneSwoole/jwt)[ Packagist](https://packagist.org/packages/june/jwt)[ RSS](/packages/june-jwt/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

JWT Singleton
=============

[](#jwt-singleton)

#### 介绍

[](#介绍)

JWT Singleton encapsulation

#### 安装

[](#安装)

```
composer require june/jwt

```

#### 使用说明

[](#使用说明)

1. Get token

```
use June\JWT\Jwt;
use June\JWT\Config;

$signingKey = "JuneSwoole";
$config = new Config();
$config->setKey($signingKey);
$config->setClaim("iss", "june");
$config->setClaim("aud", "JuneSwoole");
$config->setClaim("exp", time() + 7200);
$config->setClaim("jti", (string) getSoleId());
$token = Jwt::getInstance()->token($config);

```

2. Validate token

```
use June\JWT\JwtValidate;
use June\JWT\Config;
use June\JWT\JwtException;

try {
    $config = new Config();
    $signingKey = "JuneSwoole";
    $config->setKey($signingKey);
    $tokenClaim = JwtValidate::getInstance()->claims($config, $token);
} catch (JwtException $th) {
    echo $th->getMessage();
}

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

2

Last Release

1038d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbbadee031b20656c39e5d40afbc0b7f6aab0878b84c85b0116c3efc8f2c7492?d=identicon)[JuneSwoole](/maintainers/JuneSwoole)

---

Top Contributors

[![junechen0606](https://avatars.githubusercontent.com/u/119922830?v=4)](https://github.com/junechen0606 "junechen0606 (2 commits)")

### Embed Badge

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

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

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