PHPackages                             sky-web-dev/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. sky-web-dev/jwt

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

sky-web-dev/jwt
===============

A library for JWT manipulation

1.0.1(1y ago)02MITPHPPHP ^8.0

Since Mar 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SkyWebDev/JWT)[ Packagist](https://packagist.org/packages/sky-web-dev/jwt)[ RSS](/packages/sky-web-dev-jwt/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

JWT
===

[](#jwt)

Introduction
------------

[](#introduction)

### Installation

[](#installation)

```
composer require sky-web-dev/jwt
```

### Single Type Use

[](#single-type-use)

```
// Create a token by RSA256 algorithm
$pemKey = 'full-path/private-key.pem';
$time = 60*60; // number of seconds
$jwt = JwtInit::init($pemKey, $time, JwtAlgorithm::RSA256);
$token = $jwt->generateToken(['id' => 22, 'name' => 'John Ben']);

// Create a token by SHA256 algorithm
$time = 60*60; // number of seconds
$secretKey = 'htugjgldiufd';
$jwt = JwtInit::init($secretKey, $time);
$token = $jwt->generateToken(['id' => 22, 'name' => 'John Ben']);

// Decode tokens
$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwibmFtZSI6IlBldGFyIiwiZXhwIjoxNzQyODUwNDc2fQ.o5y2tT_TzFuNGMAy3anOxHROmhnXfbtsangECjUbumM';
$time = 60*60; // number of seconds
$secretKey = 'htugjgldiufd';
$jwt = JwtInit::init($secretKey, $time);
$jwt->decodeToken($token);
$status = $jwt->getTokenStatus();
$payload = $jwt->getTokenPayloadData();
```

### Validate token

[](#validate-token)

```
$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwibmFtZSI6IlBldGFyIiwiZXhwIjoxNzQyODUwNDc2fQ.o5y2tT_TzFuNGMAy3anOxHROmhnXfbtsangECjUbumM';
$time = 60*60; // number of seconds
$secretKey = 'htugjgldiufd';
$jwt = JwtInit::init($secretKey, $time);
$jwt->decodeToken($token);
$status = $jwt->getTokenStatus();
if ($status == JwtStatus::TOKEN_STATUS_OK) {
    // Token is valid
}
if ($status == JwtStatus::TOKEN_STATUS_EXPIRED) {
    // Token expired
}
if ($status == JwtStatus::TOKEN_STATUS_INVALID) {
    // Token is invalid
}
```

### Available Algorithms

[](#available-algorithms)

AlgorithmDescriptionJwtAlgorithm::SHA256Generate JWT using sha256 algorithmJwtAlgorithm::RSA256Generate JWT using RSA encryption

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance46

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Total

2

Last Release

418d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/sky-web-dev-jwt/health.svg)

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