Search by

dmorenof / sdk-runtime

dmorenof

Lightweight shared PHP runtime for contract-driven SDKs.

Package info

github.com/dmorenof/sdk-runtime

pkg:composer/dmorenof/sdk-runtime

Statistics

Installs: 1 113

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 3


README

PHP package CI License: MIT

The shared engine behind every SDK made by sdk-generator. A generated SDK holds only what is specific to its API (models, operations, names); sending requests, authentication, validation, errors, retries and streaming live here, written and tested once. PHP 8.4+.

The runtime holds no global state: each client owns its transport and credentials.

In thirty seconds

use Acme\Accounts\{Configuration, Users};
use Acme\Accounts\DTOs\NewUser;

Users::configure(new Configuration());   // an SDK generated from the API's specification

$new = new NewUser();
$new->name = 'Ada';

$user = Users::post($new);               // typed, validated model
echo $user->id;

Documentation

I want to… Read
Make my first call Getting started
Work with models, parameters and errors Using an SDK
Pass parameters, upload files, send cookies Sending data
Authenticate (API key, bearer, basic, OAuth2) Authentication
Set timeouts, retries, redirects, proxies, servers Transport and servers
Read headers, files, streams and error bodies Responses
Understand validation and formats Validation
Write or change a generator Operation metadata
Look up a class API reference
Know what may change between versions Public API and versioning

The full index, with a one-minute model of how the pieces fit, is docs/README.md. Notes on features as they were introduced in versions 0.4 to 0.31 are kept in docs/archive.

Compatibility

From 1.0.0 the package follows Semantic Versioning. What is stable, what is internal and what counts as a breaking change is defined in docs/PUBLIC_API.md.

Development

Use PHP 8.4+ and Composer 2:

composer install
bash ci/run-tests.sh

Source code belongs in src/ under Dmorenof\SdkRuntime\; tests belong in tests/.

GitHub Flow

Publish each completed, validated increment through main. Use a PR only when required by repository protections and complete publication in the same task. See AGENTS.md, CONTRIBUTING.md and RELEASING.md.

License

MIT; see LICENSE.