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↓50%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 1mo ago

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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

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

3045d 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

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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