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

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

flytachi/jwt
============

A modern, secure, and strictly-typed PHP library for encoding and decoding JSON Web Tokens (JWT) with JWK support.

1.0.0(8mo ago)1455↓22.2%MITPHPPHP &gt;=8.1

Since Aug 27Pushed 8mo agoCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Flytachi JWT
============

[](#flytachi-jwt)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8674e0fe17160c9447888cc37cf76936d173ceb4745d56ab06ef2ace95205ea7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c7974616368692f6a77742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/flytachi/jwt)[![PHP Version Require](https://camo.githubusercontent.com/9bf19657b4138c34eaa64e79cdbeb1951b92fc3284df02d2ddec299fd00fc58d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f666c7974616368692f6a77742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/flytachi/jwt)[![License: MIT](https://camo.githubusercontent.com/458425f8985b0b0c8a736cffe75e05a098e3d77906acddbcad2bfc54492a4e02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

**Flytachi JWT** — A modern, secure, and strongly typed PHP library for encoding and decoding JSON Web Tokens (JWT). It is built with a focus on security, ease of use, and maximum standards compliance, including full support for JSON Web Key Sets (JWKS).

Key Features
------------

[](#key-features)

- **Security-first:** Uses strict typing and value objects to prevent errors. Signature verification is protected against (`timing attacks`).
- **Modern design:** Written in modern PHP (requires PHP 8.1+) and follows best practices, including PSR standards.
- **Full JWKS support:** Built-in `JWK` parser makes it easy to work with public key sets from any provider (Google, Apple, Auth0, Privy, etc.).
- **Support for all popular algorithms:**
    - **HMAC:** `HS256`, `HS384`, `HS512`
    - **RSA:** `RS256`, `RS384`, `RS512`
    - **ECDSA:** `ES256`, `ES384`, `ES512`
- **Simple and clean API:** Convenient static methods for encoding and decoding tokens.
- **Robust error handling:** Uses specific exceptions (`JWTException`) so you can easily catch and handle any token-related issues.

Installation
------------

[](#installation)

You can install the library via [Composer](https://getcomposer.org/):

```
  composer require flytachi/jwt
```

### Usage Examples

[](#usage-examples)

```
use Flytachi\Jwt\JWT;
use Flytachi\Jwt\Entity\JwtPayload;
use Flytachi\Jwt\Entity\PrivateKey;
use Flytachi\Jwt\Entity\PublicKey;

// encode
$jwtToken = JWT::encode(
    new JwtPayload([
        'iss' => 'https://domain.com',      // Issuer: who issued the token
        'sub' => 'user-12345',              // Subject: for whom the token is intended (user ID)
        'aud' => 'https://api.domain.com',  // Audience: what service is the token intended for?
        'iat' => time(),                    // Issued At: token issue time (Unix timestamp)
        'nbf' => time(),                    // Not Before: time from which the token becomes valid
        'exp' => time() + 3600,             // Expiration Time: time when the token expires (in 1 hour)
    ]),
    new PrivateKey('secret', 'HS256')
);

// decode
$payload = JWT::decode($jwtToken, [new PublicKey('secret', 'HS256')]);
$userId = $payload->getClaim('sub');
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance60

Regular maintenance activity

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

264d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/861b81dd97c8ddfa919522d2a4e17626120bd3e3d7464857cc03784676bc74a8?d=identicon)[Flytachi](/maintainers/Flytachi)

---

Top Contributors

[![Flytachi](https://avatars.githubusercontent.com/u/68924300?v=4)](https://github.com/Flytachi "Flytachi (12 commits)")

---

Tags

jwtsecurityJWKauthAuthenticationtokenJSON Web TokenJWKS

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)[auth0/symfony

Symfony SDK for Auth0 Authentication and Management APIs.

128738.1k](/packages/auth0-symfony)[auth0/wordpress

WordPress Plugin for Auth0

17419.5k](/packages/auth0-wordpress)[benbjurstrom/cognito-jwt-guard

A laravel auth guard for JSON Web Tokens issued by Amazon AWS Cognito

1113.1k](/packages/benbjurstrom-cognito-jwt-guard)

PHPackages © 2026

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