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

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

jonlink/jwt
===========

a tiny JWT package for php

v0.2.1(1y ago)28MITPHPPHP ^8.1

Since Sep 20Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (4)Used By (0)

jwt-php
=======

[](#jwt-php)

A tiny library for jwt auth with no dependencies.

installation
------------

[](#installation)

Install via packagist &amp; composer: `composer require jonlink/jwt`

usage
-----

[](#usage)

Create a new JWT and get the token:

```
$jwt = new JwtPhp(
    payload: (object) ['foo' => 'bar'],
    secret: 'abc',
);

echo $jwt->getToken();

```

Validate a JWT:

```
$jwt = new JwtPhp(
    token: 123.abc.123,
    secret: 'foo',
);

echo $jwt->isValid() ? 'this is valid' : 'this is NOT valid';

```

Update a supported (reserved) claim:

```
$jwt = new JwtPhp(
    token: 123.abc.123,
    secret: 'foo',
);

$jwt->setExpiration(123);
$jwt->setSupportedClaim('exp', 123);

```

Update a non-supported claim:

```
$jwt = new JwtPhp(
    token: 123.abc.123,
    secret: 'foo',
);

$jwt->setClaim('funnyClaim', 'hello world');

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Total

3

Last Release

604d ago

### Community

Maintainers

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

---

Top Contributors

[![jonnylink](https://avatars.githubusercontent.com/u/20388240?v=4)](https://github.com/jonnylink "jonnylink (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[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)[illuminate/auth

The Illuminate Auth package.

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

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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