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

ActiveJetpack-library[Authentication &amp; Authorization](/categories/authentication)

automattic/jetpack-jwt
======================

A JSON Web Token (JWT) implementation for Jetpack.

v0.2.2(5mo ago)03.0k↓12.5%1GPL-2.0-or-laterPHPPHP &gt;=7.2CI failing

Since Jul 21Pushed 1mo agoCompare

[ Source](https://github.com/Automattic/jetpack-jwt)[ Packagist](https://packagist.org/packages/automattic/jetpack-jwt)[ RSS](/packages/automattic-jetpack-jwt/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (1)

jwt
===

[](#jwt)

This

How to install
--------------

[](#how-to-install)

```
composer install automattic/jetpack-jwt
```

### Installation From Git Repo

[](#installation-from-git-repo)

Contribute
----------

[](#contribute)

Create a PR in \[Jetpack Repo\].

Get Help
--------

[](#get-help)

Open in issue in the \[Jetpack Repo\].

Using this package in your WordPress plugin
-------------------------------------------

[](#using-this-package-in-your-wordpress-plugin)

If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

### How to use the class?

[](#how-to-use-the-class)

```
$payload = array(
    'hello' => 'world'
);
$secret = 'abc';

$jwt_string = Automattic/Jetpack/JWT::encode( $payload, $secret );

try{
    $descripted = Automattic/Jetpack/JWT::decode( $jwt_string, $secret );
} catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}

echo $descripted->hello;
// prints "world"
```

### Testing

[](#testing)

When introducing new features or making changes to existing code, please add tests.

To run the tests, you can use the following command: Navigate to the JWT package directory and run.

```
composer test-php
```

### PHP Phan

[](#php-phan)

In the jetpack repo

```
composer test-php packages/jwt
```

Security
--------

[](#security)

Need to report a security vulnerability? Go to  or directly to our security bug bounty site .

License
-------

[](#license)

jwt is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance81

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

4

Last Release

162d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

![](https://www.gravatar.com/avatar/11609890f6e7a840715f4cfc9622d77ea64b7dfc024df5643fbf8471a18c00f3?d=identicon)[kraft](/maintainers/kraft)

![](https://www.gravatar.com/avatar/5326730499ec14e274f51b9bcc39db6aac0fb38b33849715aae0e2587a2b93df?d=identicon)[jeherve](/maintainers/jeherve)

---

Top Contributors

[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (14 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (11 commits)")[![enejb](https://avatars.githubusercontent.com/u/115071?v=4)](https://github.com/enejb "enejb (2 commits)")[![gmjuhasz](https://avatars.githubusercontent.com/u/36671565?v=4)](https://github.com/gmjuhasz "gmjuhasz (2 commits)")[![jeherve](https://avatars.githubusercontent.com/u/426388?v=4)](https://github.com/jeherve "jeherve (2 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (2 commits)")[![chihsuan](https://avatars.githubusercontent.com/u/4344253?v=4)](https://github.com/chihsuan "chihsuan (1 commits)")[![adamwoodnz](https://avatars.githubusercontent.com/u/1017872?v=4)](https://github.com/adamwoodnz "adamwoodnz (1 commits)")[![CGastrell](https://avatars.githubusercontent.com/u/157240?v=4)](https://github.com/CGastrell "CGastrell (1 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/automattic-jetpack-jwt/health.svg)](https://phpackages.com/packages/automattic-jetpack-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)
