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

ActiveLibrary[API Development](/categories/api)

contentzen/sdk-php
==================

Official PHP SDK for ContentZen CMS

v1.0.0(9mo ago)02MITPHP

Since Jul 31Pushed 9mo agoCompare

[ Source](https://github.com/contentzen-hub/sdk-php)[ Packagist](https://packagist.org/packages/contentzen/sdk-php)[ Docs](https://contentzen.io)[ RSS](/packages/contentzen-sdk-php/feed)WikiDiscussions main Synced 1mo ago

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

ContentZen PHP SDK
==================

[](#contentzen-php-sdk)

Official PHP SDK for ContentZen CMS. Easily fetch and render content in Laravel and other PHP-based frameworks.

Installation
------------

[](#installation)

Install via Composer:

```
composer require contentzen/sdk-php

```

Usage
-----

[](#usage)

### Initialize the Client

[](#initialize-the-client)

```
use ContentZen\Client;

// For public endpoints (no authentication required)
$client = new Client();

// For private endpoints (API token required)
$client = new Client('your_api_token_here');
```

### Fetch Public Documents

[](#fetch-public-documents)

```
$documents = $client->documents()->getPublicDocuments('collection-uuid', [
    'limit' => 10,
    'offset' => 0,
    'state' => 'published',
]);
```

### Fetch a Public Document

[](#fetch-a-public-document)

```
$document = $client->documents()->getPublicDocument('collection-uuid', 'document-uuid');
```

### Fetch Private Documents (API Token Required)

[](#fetch-private-documents-api-token-required)

```
$documents = $client->documents()->getDocuments('collection-uuid', [
    'limit' => 10,
    'offset' => 0,
]);
```

### Fetch a Private Document (API Token Required)

[](#fetch-a-private-document-api-token-required)

```
$document = $client->documents()->getDocument('collection-uuid', 'document-uuid');
```

Error Handling
--------------

[](#error-handling)

All SDK methods throw `ContentZen\Exception` on error. Example:

```
use ContentZen\Exception;

try {
    $documents = $client->documents()->getDocuments('collection-uuid');
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Collections
-----------

[](#collections)

```
// List collections
$collections = $client->collections()->getCollections();

// Get a collection
$collection = $client->collections()->getCollection('collection-uuid');

// Create a collection
$new = $client->collections()->createCollection([
    'name' => 'products',
    'display_name' => 'Products',
    'description' => 'Product catalog',
    'is_public' => false,
    'fields' => [
        ['name' => 'title', 'type' => 'string', 'display_name' => 'Product Title', 'required' => true],
        ['name' => 'price', 'type' => 'number', 'display_name' => 'Price', 'required' => true],
    ]
]);

// Update a collection
$updated = $client->collections()->updateCollection('collection-uuid', [
    'display_name' => 'Updated Products',
    'description' => 'Updated product catalog',
    'is_public' => true,
]);

// Delete a collection
$client->collections()->deleteCollection('collection-uuid');

// Get collection schema
$schema = $client->collections()->getCollectionSchema('collection-uuid');

// Get collection fields
$fields = $client->collections()->getCollectionFields('collection-uuid');

// Get field types
$fieldTypes = $client->collections()->getFieldTypes();
```

Media
-----

[](#media)

```
// List media
$media = $client->media()->listMedia();

// Upload media
$uploaded = $client->media()->uploadMedia('/path/to/file.jpg');

// Get media file
$file = $client->media()->getMedia('media-uuid');

// Delete media file
$client->media()->deleteMedia('media-uuid');
```

Webhooks
--------

[](#webhooks)

```
// List webhooks
$webhooks = $client->webhooks()->listWebhooks();

// Create webhook
$newWebhook = $client->webhooks()->createWebhook([
    'url' => 'https://example.com/webhook',
    'event' => 'document.published',
]);

// Update webhook
$updatedWebhook = $client->webhooks()->updateWebhook('webhook-uuid', [
    'url' => 'https://example.com/new-webhook',
]);

// Delete webhook
$client->webhooks()->deleteWebhook('webhook-uuid');
```

Resources
---------

[](#resources)

- [ContentZen API Documentation (Postman)](https://www.postman.com/winter-meteor-7066631/contentzen/collection/9m7enab/contentzen-api)
- [ContentZen Official Website](https://contentzen.io)

License
-------

[](#license)

MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance56

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

291d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4fdee96519ebec4245a98a3801e6a0254d293c8658a68f241da0c385dbaa348e?d=identicon)[contentzen-hub](/maintainers/contentzen-hub)

---

Top Contributors

[![contentzen-hub](https://avatars.githubusercontent.com/u/222623724?v=4)](https://github.com/contentzen-hub "contentzen-hub (1 commits)")

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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