PHPackages                             blest/blest - 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. blest/blest

ActiveLibrary[API Development](/categories/api)

blest/blest
===========

The PHP reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching by default, and provides a modern alternative to REST.

1.0.1(1y ago)032MITPHPPHP &gt;=7.4

Since Jun 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jhuntdev/blest-php)[ Packagist](https://packagist.org/packages/blest/blest)[ RSS](/packages/blest-blest/feed)WikiDiscussions master Synced today

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

BLEST PHP
=========

[](#blest-php)

The PHP reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching by default, and provides a modern alternative to REST. It includes examples for Leaf, Slim, and OpenSwoole.

To learn more about BLEST, please visit the website:

For a front-end implementation in Vue, please visit

Features
--------

[](#features)

- Built on JSON - Reduce parsing time and overhead
- Request Batching - Save bandwidth and reduce load times
- Compact Payloads - Save even more bandwidth
- Single Endpoint - Reduce complexity and facilitate introspection
- Fully Encrypted - Improve data privacy

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

[](#installation)

Install BLEST PHP with Composer.

```
composer require blest/blest
```

Usage
-----

[](#usage)

### Router

[](#router)

This example uses Slim, but you can find examples with other frameworks [here](examples).

```
require __DIR__ . '/vendor/autoload.php';

use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Middleware\BodyParsingMiddleware;
use Slim\Factory\AppFactory;
use BLEST\BLEST\Router;

// Instantiate the router
$router = new Router();

// Create some middleware (optional)
$userMiddleware = function($body, $context) {
  $context['user'] = [
    // user info for example
  ];
};
$app->use($userMiddleware);

// Create a route controller
$greetController = function($body, $context) {
  return [
    'greeting' => 'Hi, ' . $body['name]' . '!'
  ];
};
$app->route('greet', $greetController);

// Create the Slim app
$app = AppFactory::create();

// Parse request body
$app->addBodyParsingMiddleware();

// Listen for POST requests on root URL ("/")
$app->post('/', function (Request $request, Response $response) use ($requestHandler) {
  $body = $request->getParsedBody();
  $context = [
    'httpHeaders' => $request->getHeaders()
  ];
  [$result, $error] = $router->handle($body, $context);
  if ($error) {
    $response->getBody()->write(json_encode($error));
    return $response->withHeader('Content-Type', 'application/json')->withStatus(500);
  } else {
    $response->getBody()->write(json_encode($result));
    return $response->withHeader('Content-Type', 'application/json')->withStatus(200);
  }
});

// Run the app
$app->run();
```

### HttpClient

[](#httpclient)

```
require __DIR__ . '/vendor/autoload.php';

use BLEST\BLEST\HttpClient;

// Create an HTTP client
$client = new HttpClient('http://localhost:8080', [
  'httpHeaders' => [
    'Authorization' => 'Bearer token'
  ]
]);

// Use the client to make a request
$client->request('greet', ['name' => 'Steve']);
```

License
-------

[](#license)

This project is licensed under the [MIT License](LICENSE).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

5

Last Release

550d ago

Major Versions

0.1.0 → 1.0.02024-10-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/117127451?v=4)[JHunt](/maintainers/jhuntdev)[@jhuntdev](https://github.com/jhuntdev)

---

Top Contributors

[![RyleySill93](https://avatars.githubusercontent.com/u/20671872?v=4)](https://github.com/RyleySill93 "RyleySill93 (22 commits)")

---

Tags

apiblestleafphpslimapislimswooleopenswooleleafblest

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/blest-blest/health.svg)

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

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22879.8k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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