Examples

Repository examples are published with the source repository, not the Composer package archive.

Basic example

A minimal server with handlers and no auth. View the basic example.

Auth example

JWT auth with a working example app. View the auth example.

Advanced example

Custom handler factory, middleware, schema validation. View the advanced example.

Browser demo

A tiny HTML page for sending raw JSON-RPC requests. View the browser demo.

Usage patterns

Direct JSON usage (no HTTP)

$json = $server->handleJson(
    '{"jsonrpc":"2.0","method":"system.health","id":1}',
    $context,
);

Custom rate limiter backend

$server->setRateLimiter(new MyRedisRateLimiter());

Response fingerprinting

'response_fingerprint' => ['enabled' => true, 'algorithm' => 'sha256'],