Download the PHP package daycry/jwt without Composer

On this page you can find all versions of the php package daycry/jwt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jwt

Donate

JWT for CodeIgniter 4

A high-performance JWT (JSON Web Token) library for CodeIgniter 4, built on top of the robust lcobucci/jwt package.

Build Status Coverage Status Downloads GitHub release (latest by date) GitHub stars GitHub license

โœจ Features

๐Ÿ“‹ Requirements

๐Ÿš€ Installation

Via Composer (Recommended)

Manual Installation

  1. Download this repository
  2. Add the namespace to app/Config/Autoload.php:

โš™๏ธ Configuration

Publish Configuration File

This creates app/Config/JWT.php with all available options:

Available CLI Commands

The library includes several helpful CLI commands:

Configuration File Structure

After publishing, you'll have app/Config/JWT.php:

Environment Variables Support

For security, use environment variables in your .env file. You can copy the provided example:

Then reference them in your configuration:

Note: CodeIgniter 4 automatically loads environment variables into configuration files, so no additional constructor is needed.

๐Ÿ“š Basic Usage

Simple Token Creation and Validation

Custom Configuration

๐ŸŽ›๏ธ Advanced Usage

Custom Data Parameter

Array Data Handling

Encoded as JSON (Default)

Split as Individual Claims

โšก High-Performance Methods

Quick Validation (No Full Decoding)

Unsafe Claim Extraction (Performance Critical)

Expiry Checking

๐Ÿ”ง Configuration Options

Validation Constraints

You can customize which constraints to validate:

Supported Algorithms

๐Ÿ› ๏ธ Integration Features

CodeIgniter 4 Services

Helper Functions (If Implemented)

๐Ÿงช Testing and Benchmarks

Run Tests

Performance Benchmark

Sample benchmark results:

๐Ÿ”’ Security Best Practices

1. Use Strong Secret Keys

The jwt:key command will automatically add the key to your .env file:

Important: Never commit your secret keys to version control. Always use environment variables.

2. Configure Appropriate Expiry Times

3. Validate All Necessary Claims

๐Ÿšจ Error Handling

With Exceptions (Default)

Without Exceptions

๐Ÿ“– API Reference

Main Methods

Method Description Performance
encode($data, $uid = null) Create JWT token Standard
decode($token) Validate and decode token Standard
isValid($token) Quick validation check Fast
extractClaimsUnsafe($token) Extract without validation Fastest
isExpired($token) Check if token expired Fast
getTimeToExpiry($token) Get seconds until expiry Fast
clearCache() Clear constraint cache Instant

Configuration Methods

Method Description
setParamData($name) Set custom data parameter name
setSplitData($enabled) Enable/disable claim splitting
getParamData() Get current data parameter name

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ’ฌ Support


All versions of jwt with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
lcobucci/jwt Version ^4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package daycry/jwt contains the following files

Loading the files please wait ....