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

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

vakata/jwt
==========

JWT token handling

4.0.1(2y ago)16.2k↓78.2%1MITPHPPHP &gt;=8.0.0

Since Mar 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/vakata/jwt)[ Packagist](https://packagist.org/packages/vakata/jwt)[ Docs](https://github.com/vakata/jwt)[ RSS](/packages/vakata-jwt/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (12)Used By (1)

JWT
===

[](#jwt)

[![Latest Version on Packagist](https://camo.githubusercontent.com/52e0f008e6daefd4cdb67dafc9b3814e2c869304d18abf0fa9909defe0047865/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616b6174612f6a77742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vakata/jwt)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/2633fdd8c677c017d574471e93b675f8890fb5a5f9a987278f52522f2e0e6f8e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f76616b6174612f6a77742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/vakata/jwt)[![Code Climate](https://camo.githubusercontent.com/8c4417944346b2ebd0d0a9022d56af02dca2c773b736845438cf454aab4e43a5/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f76616b6174612f4a57542e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/vakata/jwt)[![Tests Coverage](https://camo.githubusercontent.com/0beea3384b2c18bb31c97025e9782691fbaa61368cde518776c838782eb7ef21/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f6769746875622f76616b6174612f4a57542e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/vakata/jwt)

JWT token handling.

Install
-------

[](#install)

Via Composer

```
$ composer require vakata/jwt
```

Usage
-----

[](#usage)

```
$token = new \vakata\jwt\JWT();
$token
    ->setClaim("key", "value")
    ->setExpiration("+30 days")
    ->setIssuer("System")
    ->sign("secretKey");

$stringified = (string)$token;
$parsed = \vakata\jwt\JWT::fromString($stringified);
var_dump($parsed->isValid()); // true
var_dump($parsed->isSigned()); // true
var_dump($parsed->verifyHash("secretKey")); // true
var_dump($parsed->getClaim("key")); // "value"
```

Read more in the [API docs](docs/README.md)

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [vakata](https://github.com/vakata)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

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

Recently: every ~683 days

Total

11

Last Release

802d ago

Major Versions

1.0.0 → 2.0.02016-03-07

1.1.0 → 3.0.02016-08-13

3.0.4 → 4.0.02024-02-28

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

4.0.0PHP &gt;=8.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/146052?v=4)[Ivan Bozhanov](/maintainers/vakata)[@vakata](https://github.com/vakata)

---

Top Contributors

[![vakata](https://avatars.githubusercontent.com/u/146052?v=4)](https://github.com/vakata "vakata (21 commits)")

---

Tags

jwtvakata

### Embed Badge

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

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

###  Alternatives

[firebase/php-jwt

A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.

10.0k478.8M2.7k](/packages/firebase-php-jwt)[lcobucci/jwt

A simple library to work with JSON Web Token and JSON Web Signature

7.6k338.7M1.1k](/packages/lcobucci-jwt)[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.7k51.8M371](/packages/tymon-jwt-auth)[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k103.2M103](/packages/namshi-jose)[web-token/jwt-framework

JSON Object Signing and Encryption library for PHP and Symfony Bundle.

95220.7M103](/packages/web-token-jwt-framework)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

84611.1M63](/packages/php-open-source-saver-jwt-auth)

PHPackages © 2026

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