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

ActiveLibrary[API Development](/categories/api)

sajya/client
============

HTTP client and server for JSON-RPC 2.0

1.5.0(4mo ago)211.0M↓51.6%5[2 PRs](https://github.com/sajya/client/pulls)1MITPHPCI passing

Since Oct 18Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/sajya/client)[ Packagist](https://packagist.org/packages/sajya/client)[ Docs](https://sajya.github.io)[ RSS](/packages/sajya-client/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (9)Dependencies (10)Versions (14)Used By (1)

Introduction
------------

[](#introduction)

[![run-tests](https://github.com/sajya/client/actions/workflows/run-tests.yml/badge.svg)](https://github.com/sajya/client/actions/workflows/run-tests.yml)

This package lets you set up a JSON-RPC client over HTTP(S), using your PHP code to make the requests. Built around [Laravel](https://laravel.com/docs/8.x/http-client#introduction) (Doesn't require the entire framework, just its component) expressive HTTP wrapper, it allows you to customize things like authorization, retries, and more.

Install
-------

[](#install)

Go to the project directory and run the command:

```
$ composer require sajya/client
```

Usage
-----

[](#usage)

```
use Illuminate\Support\Facades\Http;
use Sajya\Client\Client;

$client = new Client(Http::baseUrl('http://localhost:8000/api/v1/endpoint'));

$response = $client->execute('tennis@ping');

$response->result(); // pong
```

By default, the request identifier will be generated using the [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier), you can get it by calling the `id()` method

```
$response->id();
```

To get the result of an error, you need to call the `error()` method

```
$response->error();
```

### Parameters

[](#parameters)

Example with positional parameters:

```
$response = $client->execute('tennis@ping', [3, 5]);
```

Example with named arguments:

```
$response = $client->execute('tennis@ping', ['end' => 10, 'start' => 1]);
```

### Batch requests

[](#batch-requests)

Call several procedures in a single HTTP request:

```
$batchData = $client->batch(function (Client $client) {
    $client->execute('tennis@ping');
    $client->execute('tennis@ping');
});
```

### Notify requests

[](#notify-requests)

```
$client->notify('procedure@method');
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.2% 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 ~158 days

Recently: every ~188 days

Total

9

Last Release

133d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c47797b11041f37c2eec74b09bc6619c8997467d690797ebad0e6ab7cb232b7?d=identicon)[tabuna](/maintainers/tabuna)

---

Top Contributors

[![tabuna](https://avatars.githubusercontent.com/u/5102591?v=4)](https://github.com/tabuna "tabuna (75 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (33 commits)")[![AlexLeshchenko91](https://avatars.githubusercontent.com/u/37211916?v=4)](https://github.com/AlexLeshchenko91 "AlexLeshchenko91 (1 commits)")[![kimkit](https://avatars.githubusercontent.com/u/1448791?v=4)](https://github.com/kimkit "kimkit (1 commits)")

---

Tags

apirpcjson-prc

### Embed Badge

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

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

###  Alternatives

[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1349.3k1](/packages/jasara-php-amzn-selling-partner-api)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1239.7k25](/packages/fleetbase-core-api)

PHPackages © 2026

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