GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - programmatordev/php-api-sdk: A fluent PHP library for creating API SDKs with PSR-18, PSR-17, PSR-6 and PSR-3 support

BranchesTags
Open more actions menu

Latest commit

 

History

215 Commits
215 Commits

Folders and files

NameName
Last commit message
Last commit date
.ddev
.ddev
 
 
.github/workflows
.github/workflows
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
UPGRADE-3.0.md
UPGRADE-3.0.md
 
 
composer.json
composer.json
 
 
phpunit.xml.dist
phpunit.xml.dist
 
 

Repository files navigation

PHP API SDK

Latest Version Software License Tests

These docs describe how to create API SDKs with this package.

This package is built for two developer audiences:

  • SDK authors: developers creating concrete API SDKs with this library.
  • SDK users: developers consuming those SDKs in applications.

The goal is to keep SDK authoring fluent and compact, keep SDK usage focused on real API resources, and still expose enough control for developers who need to customize or work around an SDK.

The practical guides below show how to build resources, map responses, and configure the HTTP pipeline. Read Design Approach for more about the reasoning behind the API shape.

Requirements

  • PHP >=8.1
  • PSR-18 HTTP client support
  • PSR-17 request and stream factory support

The package uses PHP-HTTP discovery for PSR-18 clients and PSR-17 factories. When the php-http/discovery Composer plugin is enabled, missing implementations can be installed automatically from the supported virtual packages.

Installation

composer require programmatordev/php-api-sdk

SDK packages may still require or suggest concrete PSR-18 and PSR-17 implementations when they want tighter control over the default HTTP stack.

Guides

  • Getting Started: create a small SDK with an API facade, resource, entity, and response mapping.
  • Design Approach: the reasoning behind fluent SDK authoring, clean SDK usage, and hackability.
  • API: SDK facade setup methods, configuration, and extension points.
  • Resource Authoring: deeper guide for resource methods, query/header options, request bodies, entity mapping, collections, envelopes, and API-specific resource chains.
  • Resources: resource classes and endpoint request helpers.
  • Responses: decoded data, raw responses, entities, collections, envelopes, and context.
  • Resolver: follow linked entities, collections, and pagination through the configured SDK runtime.
  • Authentication: configure bearer, basic, header, query, HTTPlug, and custom authentication.
  • HTTP Client: configure PSR-18 clients and PSR-17 factories.
  • Cache: configure PSR-6 HTTP response caching.
  • Logging: configure PSR-3 logging and HTTP/cache log output.
  • Plugins: configure HTTPlug middleware and priority ordering.
  • Hooks: run SDK-author callbacks around requests and responses.

Upgrading

See Upgrade to 3.0 for the high-level changes.

About

A fluent PHP library for creating API SDKs with PSR-18, PSR-17, PSR-6 and PSR-3 support

Topics

apiapi-clientapi-sdkhttp-clientphp-apiphp-sdkpsr-17psr-18psr-3psr-6sdk

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.