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 yesterday

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 31% of packages

Maintenance34

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

649d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/280856533?v=4)[jonlink](/maintainers/jonlink)[@jonlink](https://github.com/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

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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