Download the PHP package alrayyes/forge-dashboard-sdk-php without Composer
On this page you can find all versions of the php package alrayyes/forge-dashboard-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alrayyes/forge-dashboard-sdk-php
More information about alrayyes/forge-dashboard-sdk-php
Files in alrayyes/forge-dashboard-sdk-php
Package forge-dashboard-sdk-php
Short Description PHP client for forge-dashboard's REST API, generated from its OpenAPI spec with openapi-generator.
License MIT
Informations about the package forge-dashboard-sdk-php
forge-dashboard-sdk-php
A PHP client for forge-dashboard's
REST API, generated from its OpenAPI spec with
openapi-generator's php target and a
Guzzle HTTP transport. It saves you from hand-rolling HTTP requests, auth
and retries against the API yourself.
Requirements
- PHP 8.2 or later, with the
jsonextension (bundled by default). - Composer.
- A running forge-dashboard instance.
- A personal API token for that instance (see "Authentication" below) —
every endpoint except
health,getVersionand the two webhook receivers needs one.
Installation
This package isn't on Packagist yet — see "Publishing" below. Until it is,
require it as a VCS repository pointed at this Git URL, or composer require
a specific commit.
Authentication
forge-dashboard accepts either a browser's passkey session cookie or a
personal API token — Authorization: Bearer <token> — as an alternative
that needs no WebAuthn ceremony. This SDK only speaks the token half, the
one a script can actually use. Mint one by signing into the dashboard once
and calling POST /api/tokens, then pass it to the constructor or set
FORGE_DASHBOARD_API_TOKEN in the environment:
Usage
health and getVersion need no token and are good first calls to prove
the client reaches the server at all:
The aggregated dashboard needs a token, and demonstrates error handling:
Every other operation is a direct call on the matching generated Api class —
$client->settings, $client->tokens, $client->pullRequests,
$client->admin, $client->sharing, $client->auth, $client->webhooks —
each named after the spec's own tags. These throw the generated
ForgeDashboard\Generated\ApiException on any non-2xx response; convert
it to a typed error uniformly with ApiError::fromGeneratedException(), as
above.
ApiError carries the HTTP status (statusCode) and the API's own error
message (getMessage()).
The client retries a 429 or 5xx response with exponential backoff and
jitter (honoring a server-sent Retry-After), and never retries any other
4xx. Tune it via the constructor's $maxRetries/$retryBaseDelaySeconds,
or swap the underlying Guzzle handler stack entirely with $handlerStack.
Regenerating the client
See CONTRIBUTING.md — the generated code is pinned to a specific forge-dashboard commit and shouldn't drift from it silently.
Publishing
This package isn't claimed on Packagist yet — that's a manual step (linking a GitHub webhook to a Packagist account) left for a maintainer to do once the SDK is ready for general use, not something done as part of this bootstrap.
Contributing
See CONTRIBUTING.md for building, testing and the release process.
License
MIT — a permissive license for the client, independent of forge-dashboard's own AGPL-3.0.