PHPackages                             bernardosilva/jwt-api-client-php - 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. [API Development](/categories/api)
4. /
5. bernardosilva/jwt-api-client-php

ActiveLibrary[API Development](/categories/api)

bernardosilva/jwt-api-client-php
================================

API client prepared to consume API using JWT for PHP

0.0.3(8y ago)318.0k↓92.9%2GPL-3.0+PHPPHP &gt;=5.5

Since Jan 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/BernardoSilva/jwt-api-client-php)[ Packagist](https://packagist.org/packages/bernardosilva/jwt-api-client-php)[ RSS](/packages/bernardosilva-jwt-api-client-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (8)Used By (0)

JWT API Client for PHP
======================

[](#jwt-api-client-for-php)

Jason Web Token API client is a library to facilitate consuming API's that require JWT token as authentication.

[![Latest Stable Version](https://camo.githubusercontent.com/9e9e6fd302a5e3dd634c31d94e9d88a6c4fa09043c521edd07f51454e0e4409a/68747470733a2f2f706f7365722e707567782e6f72672f6265726e6172646f73696c76612f6a77742d6170692d636c69656e742d7068702f762f737461626c65)](https://packagist.org/packages/bernardosilva/jwt-api-client-php)[![Total Downloads](https://camo.githubusercontent.com/153b5ca420798d04f85152f13ee3c944236fec64ce571ce0e6df0bab6d8bd5f1/68747470733a2f2f706f7365722e707567782e6f72672f6265726e6172646f73696c76612f6a77742d6170692d636c69656e742d7068702f646f776e6c6f616473)](https://packagist.org/packages/bernardosilva/jwt-api-client-php)[![Build Status](https://camo.githubusercontent.com/31e54377e36fb5b294bb30927fc6b60fa468a7146e4e1297b4fee66b3f8c091d/68747470733a2f2f7472617669732d63692e6f72672f4265726e6172646f53696c76612f6a77742d6170692d636c69656e742d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/BernardoSilva/jwt-api-client-php)[![License](https://camo.githubusercontent.com/4778e27ea9d02a080ab9b72ff1e7a5043876a2dda7bdcaa2c9fa6fb8995b3f90/68747470733a2f2f706f7365722e707567782e6f72672f6265726e6172646f73696c76612f6a77742d6170692d636c69656e742d7068702f6c6963656e7365)](https://packagist.org/packages/bernardosilva/jwt-api-client-php)

How to Install
--------------

[](#how-to-install)

```
$ composer require bernardosilva/jwt-api-client-php

```

How to use
----------

[](#how-to-use)

```
use BernardoSilva\JWTAPIClient\APIClient;
use BernardoSilva\JWTAPIClient\AccessTokenCredentials;

$username = 'your-username';
$password = 'your-password';
$baseURI = 'api.your-domain.pt';

$client = new APIClient($baseURI);
$options = [
    'verify' => false, // might need this if API uses self signed certificate
    'form_params' => [
        'key' => $username,
        'password' => $password
    ]
];

// authenticate on API to get token
$response = $client->post('/api/v1/auth/login', $options);
$loginResponseDecoded = json_decode($response->getBody()->getContents(), true);

$credentials = new AccessTokenCredentials($loginResponseDecoded['access_token']);
$client->setCredentials($credentials);

// e.g. Request types
$client->get();
$client->delete();
$client->patch();
$client->post();
$client->put();
```

Example of how to get access token without requesting the API:

```
// When using internally with other services can generate accessToken directly
$accessToken = $JWTManager->create($user);
$credentials = new AccessTokenCredentials($accessToken);

```

How to contribute
-----------------

[](#how-to-contribute)

- Fork project
- Clone it to your machine
- Install dependencies using `composer install`
- Open a Pull Request

### How to test

[](#how-to-test)

```
$ ./vendor/bin/phpunit

```

Created by
----------

[](#created-by)

- [Bernardo Silva](https://www.bernardosilva.com)

License
-------

[](#license)

The source code is licensed under GPL v3. License is available [here](/LICENSE).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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

Total

3

Last Release

3091d ago

PHP version history (2 changes)0.0.1PHP &gt;=5.6

0.0.2PHP &gt;=5.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1537510?v=4)[Bernardo Vieira da Silva](/maintainers/BernardoSilva)[@BernardoSilva](https://github.com/BernardoSilva)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bernardosilva-jwt-api-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/bernardosilva-jwt-api-client-php/health.svg)](https://phpackages.com/packages/bernardosilva-jwt-api-client-php)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M986](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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