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

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

dracarys/jwt
============

A Lightweight PHP JSON Web Token Library

v1.0.0(6mo ago)35MITPHPPHP &gt;=8.0CI passing

Since Oct 28Pushed 2mo agoCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Dracarys JWT
============

[](#dracarys-jwt)

A lightweight and modern PHP JSON Web Token (JWT) library built for PHP 8.3+. This library provides a clean and intuitive API for creating, parsing, and validating JWT tokens with support for both symmetric (HMAC) and asymmetric ( RSA) signing algorithms.

Features
--------

[](#features)

- ✅ **Modern PHP**: Requires PHP 8.0+ with full type safety
- ✅ **Multiple Algorithms**: Support for HMAC SHA-256 and RSA SHA-256 signing
- ✅ **Symmetric &amp; Asymmetric**: Both HMAC (shared secret) and RSA (public/private key) encryption
- ✅ **Token Validation**: Comprehensive validation with custom rules
- ✅ **Standard Claims**: Full support for JWT standard claims (iss, aud, sub, iat, exp, nbf, jti)
- ✅ **Custom Claims**: Add your own custom claims to tokens
- ✅ **Fluent API**: Clean, readable method chaining
- ✅ **No Dependencies**: Lightweight with minimal external dependencies

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

[](#installation)

Install via Composer:

```
composer require dracarys/jwt
```

Requirements
------------

[](#requirements)

- PHP 8.0+

Quick Start
===========

[](#quick-start)

Symmetric Token Issuing
-----------------------

[](#symmetric-token-issuing)

```
