PHPackages                             contentpulse/contentpulse-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. [Templating &amp; Views](/categories/templating)
4. /
5. contentpulse/contentpulse-php

ActiveLibrary[Templating &amp; Views](/categories/templating)

contentpulse/contentpulse-php
=============================

The official PHP SDK for ContentPulse.io - content rendering, API client, and publishing utilities.

v0.1.0(3w ago)031MITPHPPHP ^8.2CI passing

Since May 15Pushed 3d agoCompare

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

READMEChangelog (1)Dependencies (7)Versions (2)Used By (1)

ContentPulse PHP SDK
====================

[](#contentpulse-php-sdk)

[![CI](https://github.com/contentpulseio/contentpulse-php-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/contentpulseio/contentpulse-php-sdk/actions/workflows/ci.yml)

Official PHP SDK for [ContentPulse.io](https://contentpulse.io) - content rendering, API client, and publishing utilities.

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

[](#requirements)

- PHP 8.2+

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

[](#installation)

```
composer require contentpulse/contentpulse-php
```

Quick Start
-----------

[](#quick-start)

### Create a client

[](#create-a-client)

The only required argument is your API key. When `baseUrl` is omitted, the SDK resolves it (in order) from:

1. The `CONTENTPULSE_BASE_URL` PHP constant (if defined)
2. The `CONTENTPULSE_BASE_URL` environment variable
3. The default `https://contentpulse.io`

```
use ContentPulse\Http\ContentPulseClient;

// Minimal: uses CONTENTPULSE_BASE_URL (env/constant) or defaults to https://contentpulse.io
$client = new ContentPulseClient(apiKey: 'your-api-key');

// Or override explicitly:
$client = new ContentPulseClient(
    apiKey: 'your-api-key',
    baseUrl: 'https://contentpulse.io',
);
```

The SDK performs a **single** HTTP request per call - it does not loop, retry, or `usleep`. Callers are expected to apply their own retry policy when needed.

### Resolve WordPress endpoints (SDK-managed)

[](#resolve-wordpress-endpoints-sdk-managed)

```
use ContentPulse\WordPress\Support\ContentPulseEndpointResolver;

$apiBaseUrl = ContentPulseEndpointResolver::resolveApiBaseUrlFromEnvironment();
$appBaseUrl = ContentPulseEndpointResolver::resolveAppBaseUrlFromEnvironment();
$publishEndpoint = ContentPulseEndpointResolver::buildPublishWordPressEndpoint($apiBaseUrl, $contentId);
$contentUrl = ContentPulseEndpointResolver::buildContentUrl($appBaseUrl, $contentId);
```

When no overrides are provided, the resolver auto-selects sensible defaults:

- Local/dev: `http://contentpulse.test:8080` and `http://app.contentpulse.test:5173` (when `contentpulse.test` is resolvable)
- Otherwise: `https://contentpulse.io` and `https://app.contentpulse.io`

Overrides (highest to lowest precedence): explicit argument → PHP constant (`CONTENTPULSE_API_URL`, `CONTENTPULSE_APP_URL`) → environment variable.

### Fetch content feed

[](#fetch-content-feed)

```
use ContentPulse\Core\DTO\ContentFilters;

$feed = $client->getContentFeed(new ContentFilters(
    websiteId: 1,
    perPage: 20,
));
foreach ($feed->items as $item) {
    // $item contains content metadata and structure
}
```

### Render content to HTML

[](#render-content-to-html)

```
use ContentPulse\Rendering\HtmlRenderer;

$renderer = new HtmlRenderer();
$html = $renderer->renderAll($content->sections);
```

### Section normalizer

[](#section-normalizer)

```
use ContentPulse\Rendering\SectionNormalizer;

$normalizer = new SectionNormalizer();
$normalized = $normalizer->normalize($rawSections);
```

### SEO meta tags

[](#seo-meta-tags)

```
use ContentPulse\Core\DTO\SeoMeta;

$seo = SeoMeta::fromArray($content->seo_metadata);
$html = $seo->toHtml(); // Renders , meta description, og:*, twitter:*
```

### Publish payloads

[](#publish-payloads)

Build platform-specific payloads for WordPress or Shopify:

```
use ContentPulse\Publishing\PublishPayloadBuilder;
use ContentPulse\Rendering\HtmlRenderer;

$builder = new PublishPayloadBuilder(new HtmlRenderer());
$payload = $builder->buildForWordPress($content);
// or
$payload = $builder->buildForShopify($content);
```

Architecture
------------

[](#architecture)

ModulePurpose`Core/Contracts/`Interfaces for API client, renderers, and publishers`Core/DTO/`Data transfer objects (CompatibilityInfo, PublicationRecord, SeoMeta, PublishResult)`Core/Exceptions/`Exception hierarchy for API and validation errors`Http/`REST API client for ContentPulse endpoints`Rendering/`HtmlRenderer, SectionNormalizer, SEO meta renderer`Publishing/`Publish payload builder for WordPress, Shopify, and custom platformsSupported Section Types
-----------------------

[](#supported-section-types)

The HtmlRenderer supports all section types produced by the ContentPulse content generation pipeline:

**Fixed sections:** titles, hero, cta, seo\_keywords, references

**Content sections:** content, content\_seo, conclusion

**Component sections:** steps, table, grid, checklist, faq, dos\_donts, alert, quote, pros\_cons, summary\_box, definition, key\_stats, tip\_box, comparison\_card, comparison\_table, timeline, accordion, testimonial, code\_snippet

Testing
-------

[](#testing)

```
composer test
```

Or directly:

```
./vendor/bin/phpunit
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance97

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

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

25d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fc056b672a7c2d04438f2955d425978dfe78d8c34e47c7cebf7e252382fc691?d=identicon)[contentpulse](/maintainers/contentpulse)

---

Top Contributors

[![contentpulseio](https://avatars.githubusercontent.com/u/264545974?v=4)](https://github.com/contentpulseio "contentpulseio (11 commits)")

---

Tags

contentcmsapi clientseoRenderingcontentpulse

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[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)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[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)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M395](/packages/drupal-core-recommended)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

744284.3k34](/packages/civicrm-civicrm-core)

PHPackages © 2026

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