PHPackages                             linkbridge/sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. linkbridge/sdk-php

ActiveLibrary[API Development](/categories/api)

linkbridge/sdk-php
==================

PHP SDK for the Linkbridge SI + APP e-invoicing API.

v0.1.2(3d ago)01Apache-2.0PHP ^8.1

Since Jul 2Compare

[ Source](https://github.com/linkbridge-systems/sdk-php)[ Packagist](https://packagist.org/packages/linkbridge/sdk-php)[ Docs](https://docs.linkbridge.ng)[ RSS](/packages/linkbridge-sdk-php/feed)WikiDiscussions Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

Linkbridge PHP SDK
==================

[](#linkbridge-php-sdk)

Idiomatic PHP client for the Linkbridge SI + APP API.

```
use Linkbridge\LinkbridgeClient;

$client = new LinkbridgeClient([
    'base_url'      => 'https://api.linkbridge.ng',
    'client_id'     => getenv('LB_CLIENT_ID'),
    'client_secret' => getenv('LB_CLIENT_SECRET'),
    'scopes'        => ['invoices:read', 'invoices:write'],
]);

$invoice = json_decode(file_get_contents(__DIR__.'/invoice.json'), true);

$accepted = $client->invoices->submit($invoice, LinkbridgeClient::idempotencyKey());
echo $accepted['irn'].PHP_EOL;
```

Design notes
------------

[](#design-notes)

- **Zero runtime Composer dependencies.** Built on the bundled `curl`, `json`, `openssl`, and `hash` extensions only. Same posture as the Python SDK (ADR-0022) so the package installs on any FIRS-issued image without `composer require`.
- **Resource grouping** mirrors the Go / Node / Python SDKs: `client->invoices->{submit,get,list,transmit,updateStatus}`, `client->webhooks->{create,list,delete}`, `client->lookups->*`.
- **OAuth2 client-credentials** with a lazy in-memory token cache refreshed 60 seconds before expiry. Pass a `static_token` to bypass the OAuth dance for ops scripts.
- **Pluggable transport**: any class implementing `Linkbridge\Transport\TransportInterface` can replace `CurlTransport`, which is what the unit tests do (no live HTTP needed).
- **Webhook verifier** in `Linkbridge\Webhook::verify()` mirrors the reference implementation in the API server byte-for-byte.

Requirements
------------

[](#requirements)

- PHP **8.1+**
- Extensions: `curl`, `json`, `openssl`, `hash` (all in php-core)

Install
-------

[](#install)

```
composer require linkbridge/sdk-php
```

…or just copy `src/` into your project — there are no transitive deps.

Running the tests
-----------------

[](#running-the-tests)

```
docker run --rm -v "$PWD:/app" -w /app php:8.3-cli \
  php vendor/bin/phpunit --testdox
```

The included `composer.json` has no runtime requires; `phpunit/phpunit`is a `require-dev` only and is fetched the first time you run `composer install`.

Webhook verification
--------------------

[](#webhook-verification)

```
use Linkbridge\Webhook;
use Linkbridge\SignatureError;

try {
    Webhook::verify(
        secret: $secretBytes,                // raw bytes from POST /v1/webhooks
        body:   file_get_contents('php://input'),
        header: $_SERVER['HTTP_X_LINKBRIDGE_SIGNATURE'] ?? '',
    );
} catch (SignatureError $e) {
    http_response_code(401);
    return;
}
```

`Webhook::verify()` enforces the same 5-minute replay window the server-side verifier uses and compares the digest in constant time via `hash_equals`.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance99

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

3d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a5272bce4ca8efefd925ff143f45cafbc37436bf51b149d6fe010ccafd04d05?d=identicon)[linkbridge](/maintainers/linkbridge)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/linkbridge-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/linkbridge-sdk-php/health.svg)](https://phpackages.com/packages/linkbridge-sdk-php)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k17](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
