PHPackages                             mehdibo/ft-client - 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. mehdibo/ft-client

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

mehdibo/ft-client
=================

Client library for Forty Two Intranet API

v1.0.1(3y ago)3118MITPHPPHP ^8.1

Since Sep 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mehdibo/ft-client)[ Packagist](https://packagist.org/packages/mehdibo/ft-client)[ RSS](/packages/mehdibo-ft-client/feed)WikiDiscussions develop Synced today

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

ft-client
=========

[](#ft-client)

[![Latest Stable Version](https://camo.githubusercontent.com/3ca687c9e1d3814fe75f7dd721fe02837f3b4cc9519ddeba4c29c1617a885db5/687474703a2f2f706f7365722e707567782e6f72672f6d65686469626f2f66742d636c69656e742f76)](https://packagist.org/packages/mehdibo/ft-client)[![Latest Unstable Version](https://camo.githubusercontent.com/24a7f0d0a347e4ac4d97a1951621b548058795d666a66224b2ced400a06910c0/687474703a2f2f706f7365722e707567782e6f72672f6d65686469626f2f66742d636c69656e742f762f756e737461626c65)](https://packagist.org/packages/mehdibo/ft-client)[![License](https://camo.githubusercontent.com/a8f3623ce6ccce7af91afb5cc3af19ac7b398eda3217545e6f8c921f9324c9ba/687474703a2f2f706f7365722e707567782e6f72672f6d65686469626f2f66742d636c69656e742f6c6963656e7365)](https://packagist.org/packages/mehdibo/ft-client)[![Total Downloads](https://camo.githubusercontent.com/c558461887e75965b279d15ed026d466e48030e7c2247ef64f59616c6748947a/687474703a2f2f706f7365722e707567782e6f72672f6d65686469626f2f66742d636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/mehdibo/ft-client)[![PHP Version Require](https://camo.githubusercontent.com/8f9ba6a2d7c260eee6db0702587b043a0ac6e45ea13b10f87eed75e2a87a7101/687474703a2f2f706f7365722e707567782e6f72672f6d65686469626f2f66742d636c69656e742f726571756972652f706870)](https://packagist.org/packages/mehdibo/ft-client)[![Unit tests](https://github.com/mehdibo/oauth2-fortytwo/workflows/Unit%20tests/badge.svg?branch=main)](https://github.com/mehdibo/oauth2-fortytwo/workflows/Unit%20tests/badge.svg?branch=main)

Client library to consume the 42 Intranet's API

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

[](#installation)

```
composer require mehdibo/ft-client
```

Usage examples
--------------

[](#usage-examples)

- [Using the Authorization Code grant](#using-the-authorization-code-grant)
- [Using the Client Credentials grant](#using-the-client-credentials-grant)
- [Enumerating pages](#enumerating-pages)

### Using the Authorization Code grant

[](#using-the-authorization-code-grant)

```
include 'vendor/autoload.php';

$client = \Mehdibo\FortyTwo\Client\BasicClientFactory::createFromCredentials(
    'CLIENT_ID',
    'CLIENT_SECRET',
    'REDIRECT_URI'
);

$client->fetchTokenFromAuthCode($_GET['code']);
$user = $client->get("/me");
```

### Using the Client Credentials grant

[](#using-the-client-credentials-grant)

```
include 'vendor/autoload.php';

$client = \Mehdibo\FortyTwo\Client\BasicClientFactory::createFromCredentials(
    'CLIENT_ID',
    'CLIENT_SECRET',
    'REDIRECT_URI'
);

// This is not necessary, if no token was fetched it will automatically fetch one using the Client Credentials grant
$client->fetchTokenFromClientCredentials();

$cute = $client->get("/users/norminet");
```

### Enumerating pages

[](#enumerating-pages)

This client comes with a method to easily enumerate pages of a paginated API endpoint.

```
include 'vendor/autoload.php';

$client = \Mehdibo\FortyTwo\Client\BasicClientFactory::createFromCredentials(
    'CLIENT_ID',
    'CLIENT_SECRET',
    'REDIRECT_URI'
);

$users = $client->enumerate("/users", [
    'sort' => '-id',
]);

try {
    foreach ($users as $user) {
        echo $user['login'] . PHP_EOL;
    }
} catch (\Mehdibo\FortyTwo\Client\Exception\EnumerationRateLimited $e) {
    echo "Rate limited, retry in " . $e->retryAfter . " seconds\n";
    echo "Stopped at page " . $e->reachedPage . "\n";
}
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

2

Last Release

1394d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

phpapiclientAuthenticationoauthoauth2authorization42fortytwoft42 school1337

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mehdibo-ft-client/health.svg)

```
[![Health](https://phpackages.com/badges/mehdibo-ft-client/health.svg)](https://phpackages.com/packages/mehdibo-ft-client)
```

###  Alternatives

[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

196.6k](/packages/andalisolutions-oauth2-anaf)[cronofy/cronofy

SDK for Cronofy - the Scheduling Platform for Business

21817.1k](/packages/cronofy-cronofy)

PHPackages © 2026

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