PHPackages                             wuemv/content-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. wuemv/content-sdk-php

ActiveLibrary[API Development](/categories/api)

wuemv/content-sdk-php
=====================

Official PHP SDK for the Wue CMS — typed client for content, media, submissions, and apps.

v0.1.0(4w ago)02↓100%MITPHPPHP ^8.4

Since May 12Pushed 4w agoCompare

[ Source](https://github.com/wuemv/content-sdk-php)[ Packagist](https://packagist.org/packages/wuemv/content-sdk-php)[ Docs](https://github.com/wuemv/content-sdk-php)[ RSS](/packages/wuemv-content-sdk-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

@wuemv/content-sdk-php
======================

[](#wuemvcontent-sdk-php)

Official PHP SDK for the [Wue CMS](https://wue.mv).

Sibling to [`@wuemv/content-sdk`](https://www.npmjs.com/package/@wuemv/content-sdk) (JS/TS). Same API surface, idiomatic PHP — typed value objects, Stripe-style resource methods, PSR-18 transport.

Install
-------

[](#install)

```
composer require wuemv/content-sdk-php
```

Requires PHP 8.4+.

> Using Laravel? Install [`wuemv/content-sdk-laravel`](https://github.com/wuemv/content-sdk-laravel) instead for a service provider, `Wue` facade, and `config/wue.php`.

Usage
-----

[](#usage)

```
use Wuemv\ContentSdk\Client;

$wue = new Client(
    apiKey: 'wue_...',                              // bearer token from CMS settings
    siteId: 'portfolio',                             // optional, for clarity in your code
    baseUrl: 'https://your-wue-instance.com/api',    // API root — INCLUDE /api suffix
);

// Health check / setup confirmation
$health = $wue->ping->check();
// → ['ok' => true, 'api_version' => 'v1', 'site' => [...], 'server_time' => '...']

// Schema discovery
$types = $wue->contentTypes->list();
foreach ($types as $ct) {
    echo $ct->slug;                    // 'blog', 'product', ...
    echo $ct->name;
    foreach ($ct->fields as $field) {
        echo "  - {$field->key} ({$field->type})";
    }
}

// Single content type
$blog = $wue->contentTypes->retrieve('blog');

// List entries
$posts = $wue->entries->list('blog');
foreach ($posts as $post) {
    echo $post->slug;                              // typed static property
    echo $post->fields->string('title');            // typed dynamic accessor
    echo $post->fields->date('published_at');       // ?DateTimeImmutable
    echo $post->fields['body'];                     // array access also works
}

// Single entry
$post = $wue->entries->retrieve('blog', 'hello-world');
```

### Local development (self-signed certs)

[](#local-development-self-signed-certs)

Running against a local Herd / self-signed CMS instance? Pass a Guzzle client with SSL verification off:

```
use GuzzleHttp\Client as GuzzleClient;

$wue = new Client(
    apiKey: '...',
    baseUrl: 'https://cms.yoursite.test/api',
    httpClient: new GuzzleClient(['verify' => false]),
);
```

Don't disable verification in production — your trusted CA chain handles real certs.

Typed entries via codegen
-------------------------

[](#typed-entries-via-codegen)

For full IDE + PHPStan typing over your site's actual content types, generate typed Entry classes from the live schema:

```
vendor/bin/wue-types \
    --api-key=$WUE_API_KEY \
    --base-url=$WUE_BASE_URL \
    --output=src/Wue \
    --namespace='App\Wue'
```

This produces three kinds of output:

```
src/Wue/
├── ContentType.php          ← enum { Blog = 'blog', Product = 'product', ... }
├── BlogEntry.php             ← typed: title(), excerpt(), publishedAt(), ...
└── ProductEntry.php

```

Then in your code:

```
use App\Wue\BlogEntry;
use App\Wue\ContentType;

// Pass the enum — the SDK hydrates into BlogEntry, not generic Entry
$posts = $wue->entries->list(ContentType::Blog);

foreach ($posts as $post) {
    /** @var BlogEntry $post */
    echo $post->title();              // string, type-safe
    echo $post->publishedAt()?->format('Y-m-d');
    echo $post->slug;                  // inherited from Entry
}
```

The CLI is env-driven too — `WUE_API_KEY`, `WUE_BASE_URL`, `WUE_OUTPUT_DIR`, `WUE_NAMESPACE`, `WUE_VERIFY_SSL=0` are all honoured.

Recommended: run in CI to keep your committed types in sync with production schema.

Field-type mapping
------------------

[](#field-type-mapping)

The SDK's `FieldBag` and the codegen tool both understand these field types:

Wue field typeFieldBag accessorPHP type`text`, `longtext`, `richtext`, `string`, `media`, `url`, `email`, `select``string()``?string``number``float()``?float``integer`, `int``int()``?int``boolean`, `bool``bool()``bool``date`, `datetime``date()``?DateTimeImmutable``json``get()``mixed`*unknown*`string()` (fallback)`?string`Errors
------

[](#errors)

The SDK throws a typed exception hierarchy:

```
Wuemv\ContentSdk\Exception\ContentSdkException
├── ConfigurationException     ← bad SDK setup (missing api key, etc.)
├── ConnectionException        ← network failure
└── ApiException               ← any 4xx/5xx response
    ├── AuthenticationException ← 401
    ├── PermissionException     ← 403
    ├── NotFoundException       ← 404
    ├── ValidationException     ← 422 (with field errors)
    └── RateLimitException      ← 429

```

```
try {
    $wue->ping->check();
} catch (\Wuemv\ContentSdk\Exception\AuthenticationException $e) {
    // Invalid API key
} catch (\Wuemv\ContentSdk\Exception\ContentSdkException $e) {
    // Anything else from the SDK
}
```

Testing
-------

[](#testing)

The SDK accepts any PSR-18 HTTP client via the `httpClient:` constructor arg. Use Guzzle's `MockHandler` for unit tests, or your own fake:

```
$mock = new GuzzleHttp\Handler\MockHandler([
    new GuzzleHttp\Psr7\Response(200, [], '{"ok": true}'),
]);
$client = new Wuemv\ContentSdk\Client(
    apiKey: 'wue_test',
    baseUrl: 'https://api.example.com',
    httpClient: new GuzzleHttp\Client([
        'handler' => GuzzleHttp\HandlerStack::create($mock),
    ]),
);
```

What's built
------------

[](#whats-built)

- ✅ Client, Transport, exception hierarchy
- ✅ Ping (health check)
- ✅ ContentTypes (`list`, `retrieve`)
- ✅ Entries (`list`, `retrieve`) — read-only
- ✅ Codegen tool (`vendor/bin/wue-types`) — generates `ContentType` enum + typed Entry subclasses
- ⏳ Entries mutations (create / update / delete / publish)
- ⏳ Media (upload / list / delete)
- ⏳ Submissions (form inbox)
- ⏳ Webhook signature verifier + typed event objects

Development
-----------

[](#development)

```
composer install
composer test       # pest
composer format     # pint
composer analyse    # phpstan
```

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance94

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

28d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c223e219278ca654357b69f8a851d4cd5b0657b8d81bb833f016f44748cc0a60?d=identicon)[wadday](/maintainers/wadday)

---

Top Contributors

[![wadday](https://avatars.githubusercontent.com/u/194339?v=4)](https://github.com/wadday "wadday (3 commits)")

---

Tags

phplaravelsdkcontentcmsheadless cmswue

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k532.1M2.5k](/packages/aws-aws-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M710](/packages/sylius-sylius)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M11](/packages/aporat-store-receipt-validator)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k5](/packages/theodo-group-llphant)

PHPackages © 2026

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