Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Client Laravel Package

sajya/client

A lightweight JSON-RPC client for Laravel and PHP that provides an expressive API for calling remote RPC methods and handling structured responses, making it easy to integrate external JSON-RPC services into your application.

View on GitHub
Deep Wiki
Context7

JSON-RPC 2.0 HTTP(S) Client

Frequently asked questions about Client
How do I install Sajya Client in a Laravel app?
Install the package with Composer using composer require sajya/client. Then configure your JSON-RPC endpoint, headers, and timeout values according to the package README. Because it integrates with Laravel's HTTP client, it should fit naturally into an existing Laravel service container and configuration setup. Validate the package constraints against your application's locked Laravel and PHP versions before rolling it out.
Which Laravel and PHP versions does sajya/client 1.5.0 support?
The 1.5.0 release updated illuminate/http and illuminate/support constraints, but the release notes do not spell out the exact supported Laravel and PHP ranges. Check the package composer.json and run Composer conflict checks against your application before upgrading. Test composer update sajya/client --with-dependencies on a branch rather than performing broad dependency updates during initial validation.
Does Sajya Client support batch JSON-RPC requests?
Yes. Sajya Client provides a fluent API for both single and batch JSON-RPC requests. This makes it suitable for calling multiple remote RPC methods in one HTTP round trip when the server supports JSON-RPC batch semantics. You should still test batch behavior against your specific RPC server and error-handling expectations.
How does Sajya Client handle JSON-RPC errors and notifications?
The package is designed to handle JSON-RPC request formatting, response parsing, notifications, and structured errors. That means you can work with parsed responses instead of manually constructing JSON-RPC envelopes. For production use, add tests around your expected error codes and confirm how errors propagate through your application's adapter layer.
Can I configure authentication headers and timeouts with Sajya Client?
Sajya Client supports configurable endpoints, headers, and timeouts, which lets you pass authentication tokens or other required headers through the underlying Laravel HTTP client. Confirm the exact configuration keys and supported auth patterns in the package README. For critical integrations, validate timeout behavior in staging before relying on it in production.
Does Sajya Client support retries and circuit breakers?
The package overview highlights configurable endpoints, headers, timeouts, notifications, and structured errors, but it does not call out built-in retries or circuit breakers. You can typically implement bounded retries through Laravel's HTTP client options or wrap calls in your own resilience layer. Avoid unbounded retry loops and add circuit breakers or fallbacks for critical RPC dependencies.
How should I test Sajya Client calls in Laravel?
Because Sajya Client uses Laravel's native HTTP client, you can generally use Laravel HTTP client fakes in your test suite to simulate JSON-RPC responses and errors. Add contract tests for successful responses, structured error envelopes, notifications, batches, and timeouts. Keep the client behind an internal adapter so you can test application logic without depending on a live RPC endpoint.
Is sajya/client actively maintained?
Release 1.5.0 is a minor maintenance release with CI cache updates and Illuminate dependency constraint changes, suggesting maintenance activity rather than major feature investment. It is a community package without a vendor SLA, so assign an internal owner and review changelogs before upgrading. Pin to a tested minor version and maintain a fallback path for critical integrations.
What are alternatives to Sajya Client for calling JSON-RPC APIs?
Alternatives include calling JSON-RPC endpoints directly with Laravel's HTTP client, using generic Guzzle-based JSON-RPC libraries, or building a small internal RPC adapter. Sajya Client is a good fit when you want an expressive Laravel-friendly API for single and batch requests with structured responses. If your organization is standardized on REST or GraphQL, confirm that a JSON-RPC use case justifies adding another integration style.
What production risks should I consider before using Sajya Client?
Watch for Composer dependency conflicts, RPC timeouts, retry storms, authentication misconfiguration, server-client version mismatches, and unclear JSON-RPC error propagation. Configure timeouts and headers deliberately, add bounded retries and circuit breakers where appropriate, and monitor error rates and latency around RPC calls. Start with a low-risk endpoint behind a feature flag or internal configuration before expanding usage.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource