NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #2945 most downloaded on Packagist
SDK for the Contentful Content Delivery API
Last release 1 years ago
17 Sep 2025
Release timing varies
gaps range from 5 weeks to 1.1 years
Nearly every release is documented
notes for 42 of 44 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
55 releases · first in 2015
New parameter to Entry::all() to resolve nested assets links
Support for recursive resolution of Entry links
One column per quarter.
Re-enabled unit tests for PHP8.2
Fixed cache handling for queries with default locale, see #320 - thanks Fabiana Romagnoli (@fabianaromagnoli) !
Breaking change : Dropped support for PHP7
--ignore-platform-reqs for now (the other dependencies will work), but PHP8.2 is not officially supported for now.Support for caching of Client::getEntries() - thanks Manuele Menozzi (@mmenozzi) !
Updated Symfony dependencies to allow for Symfony 6
Changed name from "SDK" to "Library"
Added php8 support Smaller code clean-ups
Added withoutMessageLogging option
withoutMessageLogging option
Nothing published for this version
> Minor non-breaking changes suggeste by phpstan
Minor non-breaking changes suggeste by phpstan
Nothing published for this version
### Changed > Upgraded symfony/console
Upgraded symfony/console
> Added support for PHP 7.4. Removed support for PHP 7.0 & 7.1. Updated dependencies.
Added support for PHP 7.4. Removed support for PHP 7.0 & 7.1. Updated dependencies.
corrected composer dependency for richtext-php
Bumping major version due to breaking change in rich-text.php
Cannot fetch large number of independent entries
Fixed infinite loop when trying to lad a rich text entry that references itself
Fixed issue with link resolution.
Sync API now correctly works with deleted entries.
master environment.The latter class was known as Contentful\Delivery\ResourcePool, which has now been deprecated and will be removed in version 5.0. The Extended class i…
Contentful\Delivery\ResourcePool\Standard, which is a lightweight implemention and only caches space, environment and content types, and Contentful\Delivery\ResourcePool\Extended, which also keeps a reference to entries and assets. The latter class was known as Contentful\Delivery\ResourcePool, which has now been deprecated and will be removed in version 5.0. The Extended class is the default one, as it is designed to work with regular PHP requests. In order to use the Standard pool, you must enable it through the ClienOptions class:$options = ClientOptions::create()
->withLowMemoryResourcePool();
$client = new Client($token, $spaceId, $environmentId, $options);
As this resource pool provides no caching (and include values are now skipped, for this reason), it might cause the SDK to make more API calls, so its used is discouraged for regular web applications.Resolving links from an entry using non-default locale caused the SDK to wrongly assume the locale=*. Now this is fixed, and the entry will use either
locale=*. Now this is fixed, and the entry will use either its current locale, if set, or the the locale=* if no locales are currently configured.Second parameter in LinkResolver::resolveLinkCollection() was changed from string $locale = null to array $parameters = [].
LinkResolver::resolveLinkCollection() was changed from string $locale = null to array $parameters = [].ATTENTION: This release contains breaking changes. Please take extra care when updating to this version. See the upgrade guide for more.
ATTENTION: This release contains breaking changes. Please take extra care when updating to this version. See the upgrade guide for more.
Client constructor signature was changed: public function __construct(string $accessToken, string $spaceId, string $environmentId = 'master', \Contentful\Delivery\ClientOptions $options = null). All options that were previously handled through the remaining parameters or the options array can now be set using the ClientOptions object. See the upgrade guide for a more detailed explanation. [BREAKING]Client object now implements Contentful\Delivery\Client\ClientInterface. We encourage users to type hint against this interface rather than against the concrete implementation.contentful/core package. We encouraged users to check its changelog and upgrade guide.Query::where() method used to accept a third parameter, which was used to specify the type of search (for instance with operators near or lte). As many users did not know this and appended the operator to the first parameter of where(), now the third parameter was removed. [BREAKING]SystemProperties class with many nullable properties, now every resource type has its own system properties implementation. For instance, the calling Contentful\Delivery\Resource\Entry::getSystemProperties() will now return an instance of Contentful\Delivery\SystemProperties\Entry, which contains only the necessary methods. [BREAKING]Entry::has() when checking against a link by default checks if the link can also be resolved. This behavior can be turned off by setting the third parameter to false.Client to a LinkResolver object. The client still provides a convenience resolveLink() method which forwards the call.Client::isPreview() was renamed Client::isPreviewApi(). Its opposite, Client::isDeliveryApi(), was also added. [BREAKING]Contentful\Delivery\Mapper\BaseMapper::hydrate() was removed. If using a custom mapper, you can use $this->hydrator->hydrate(object|string $target, array $data). [BREAKING]CacheItemPoolFactoryInterface now enforces the return type. [BREAKING]InstanceRepository was renamed ResourcePool, and method Client::getInstanceRepository() was renamed Client::getResourcePool(). [BREAKING]ResourcePool::generateKey() contained the $api parameter, which was removed as a resource pool object is supposed to operate within a single API context. [BREAKING]$preview to $isDeliveryApi, which is the opposite value. However, users should never build the manager themselves, as they should access it through Client::getSyncronizationManager(). [BREAKING]Entry::getSomething() with an invalid field previously resulte in an error being triggered. This behavior was fixed and now a regular InvalidArgumentException is thrown. [BREAKING]The SDK can now use a locally-cached copy of entries and asset. While this _will not_ prevent API calls when using getEntries or getAssets, it will in
getEntries or getAssets, it will intercept calls made with getEntry and getAsset, including those being made when resolving a link from an entry. You can enable this either using the CLI commands with the --cache-content flag, or passing 'cacheContent' => true to the $options array in the client constructor (requires 'autoWarmup' to also be set to true).Added getSpaceId and getEnvironmentId to the Client.
getSpaceId and getEnvironmentId to the Client.Fixed incremental build of entries with non-default locale.
The SDK internally keeps a registry of built resources, and for this reason, partially selecting fields in an entry might have resulted in successive
-) as a separator in cache keys. However, some more restrictive PSR-6 implementations do not allow that, so it's been changed to a dot (.) instead.Maintenance release.
Maintenance release.
Sync API now also works on non-master environments.
Entries now have a has($field) method (with a magic hasX() equivalent) which returns whether an entry has the given field currently loaded.
has($field) method (with a magic hasX() equivalent) which returns whether an entry has the given field currently loaded.__call method now allow for access also using the actual field name, without get prefix (for instance $entry->title()). This was done to further improve compatibility on edge cases with templating engines such as Twig.Cache keys now include space ID and environment ID to better handle possible edge cases.
Updated the SDK to use a stable version of contentful-core.
The SDK now requires at least PHP 5.6; however, PHP 5.6 is not actively supported and currently only security fixes are provided. Because of this, we…
ATTENTION: This release contains breaking changes. Please take extra care when updating to this version. See the upgrade guide for more.
ResourceBuilder now supports custom data type matchers so users can create their own custom resource classes.Contentful\Delivery\Resource\BaseResource, which implements Contentful\Core\Resource\ResourceInterface. You can use these two classes for type hinting.__get ($entry->title) and using the ArrayAccess interface ($field['title']).Unknown, and it will also trigger a silenced error of level E_USER_WARNING (so users can implement some custom logic for handling the issue, without causing any problems to the actual execution). When retrieving the unknown field, it will be returned as it was fetched from the API, so no conversion will be made. This means that dates will be returned as strings, links will be returned as simple arrays, etc. This solution was implemented to prevent the SDK from crashing during those (hopefully) brief moments where the cache is out of sync with Contentful, and it should not be relied upon for actually handling the fields in a proper way.DynamicEntry, Asset, ContentType, ContentTypeField, Space, and Locale, DeletedAsset, 'DeletedEntry', and DeletedContentType classes have been moved to a different namespace. Please check the the upgrade guide for more details. [BREAKING]Contentful\Delivery namespace have been moved to a separate package called contentful-core.php.baseUri instead of uriOverride, to be more consistent with the one used in Guzzle. [BREAKING]Client::getMessages(), which returns an array of Contentful\Core\Api\Message. [BREAKING]Contentful\Delivery\InstanceRepository. This class also wraps the PSR-6 cache pool.Client::reviveJson() is now called Client::parseJson() to better reflect its meaning.master environment. When trying to perform sync-related operations on a client which is configured with any other environment, a \RuntimeException will be thrown.locale=*, the locale fallback chain will not be used. The Sync API defaults to using all locales, so it's not affected. [BREAKING]Contentful\Delivery\EntryInterface no longer exists. Use Contentful\Delivery\Resource\Entry for type hinting. [BREAKING]Contentful\JsonHelper was deprecated in 2.2, and has now been removed. [BREAKING]Contentful\DateHelper was deprecated in 2.2, and has now been removed. [BREAKING]Contentful\File\UploadFile was deprecated in 2.1, and has now been removed. Use Contentful\Core\File\RemoteUploadFile instead. [BREAKING]ResourceBuilder. [BREAKING]Asset, ContentType, Entry, and DeletedResource classes previously provided shortcut methods for accessing system properties such as revision, createdAt, etc. These shortcut methods have been removed from the main resource, but they're still accessible through a SystemProperties object. See the upgrade guide for more. [BREAKING]Nothing published for this version
The Contentful\Synchronization\Manager class now provides a convenience method called sync($token = null, Query $query = null) which transparently han
Contentful\Synchronization\Manager class now provides a convenience method called sync($token = null, Query $query = null) which transparently handles a full sync, instead of having to manually call startSync and continueSync. The method returns instances of Contentful\Synchronization\Result wrapped in a \Generator object.Contentful\Exception\BadRequestException.If a method is public, it's assumed to be part of the API surface of the SDK, and thus any breaking change to that would require a new major version.
Contentful\Delivery\Query class now has linksToEntry('<entry_id>') and linksToAsset('<entry_id>') methods. For users on older versions of the SDK, the same operators can be emulated by using $query->where('links_to_entry', '<entry_id>') and $query->where('links_to_asset', '<asset_id>'). DynamicEntry also provides a shortcut in the form $entry->getReferences().@Symfony:risky ruleset is currently implemented, but this could be subject to change in the event of possible incompatibilities. The style check is a mandatory part of CI.@api or @internal. If a method is public, it's assumed to be part of the API surface of the SDK, and thus any breaking change to that would require a new major version.Dependencies to symfony/console and symfony/filesystem now also allow version ~4.0.
symfony/console and symfony/filesystem now also allow version ~4.0.DateHelper::formatForJson() is now deprecated and will be removed in version 3. Use Contentful\format_date_for_json() instead.
DateHelper::formatForJson() is now deprecated and will be removed in version 3. Use Contentful\format_date_for_json() instead.JsonHelper::encode() and JsonHelper::decode() are now deprecated and will be removed in version 3. Use GuzzleHttp\json_encode() and GuzzleHttp\json_decode() instead.LogEntry now modifies the exception stack trace (if present) to prevent problems during serialization.Allow the exception map in Client to be overridden. This is done in preparation of the upcoming CMA SDK.
Client to be overridden. This is done in preparation of the upcoming CMA SDK.$options of the Client::request() method now accepts an optional value with key baseUri. This is in preparation for the CMA SDK.LocalUploadFile now handles asset files which have been uploaded to upload.contentful.com but have yet to be processed. This fixes a possible edge case, and it's also done in preparation for the upcoming CMA SDK.Contentful\Client now includes a getLogger method, for easy access to the logger currently in use.ResourceBuilder.SynchronizationManager::continueSync().ResourceBuilder now correctly handles locale when building referenced assets.
ResourceBuilder now correctly handles locale when building referenced assets.Asset::getFile now uses fallback chain logic to determine the locale to use.ATTENTION: This release contains breaking changes. Please take extra care when updating to this version.
ATTENTION: This release contains breaking changes. Please take extra care when updating to this version.
Link implements the JsonSerializable interface. This is done in preparation for the upcoming CMA SDK.UploadFile class now manages files which aren't yet processed (for Preview API) [BREAKING]. Contentful\Delivery\Asset::getFile now returns Contentful\Delivery\File\FileInterface instead of one of File|ImageFile. If you were type hinting on either one of those, please now use the interface or add UploadFile to the possible types.ApiException. This class gives access to some additional data like, the request, response and request ID.Client to support a future CMA SDK.contentful script used to warm up/clear the cache was not marked as a binary in composer.json and thus not published to vendor/bin.<info> can't be used as part of an Exception message. (#129)Client::request ignored the timer returned in LoggerInterface::getTimer when timing requests.Contentful\File [BREAKING].
Contentful\File to Contentful\File\FileContentful\ImageFile to Contentful\File\ImageFileContentful\ImageOptions to Contentful\File\ImageOptionsImplemented ResourceArray::getItems to allow access to the values of a ResourceArray as an actual PHP array.
ResourceArray::getItems to allow access to the values of a ResourceArray as an actual PHP array.X-Contentful-User-Agent header.Implemented DeletedEntry::getContentType() to be used with webhooks.
DeletedEntry::getContentType() to be used with webhooks. (#101)guzzlehttp/psr7 is now 1.4.Content in disabled fields can now be read.
The caching of resolved links does not work for an array of links.
ATTENTION: This release contains breaking changes. Please take extra care when updating to this version.
ATTENTION: This release contains breaking changes. Please take extra care when updating to this version.
Contentful\Delivery\Link to Contentful\LinkContentful\Delivery\ImageOptions to Contentful\ImageOptionsContentful\Delivery\File to Contentful\FileContentful\Delivery\ImageFile to Contentful\ImageFileResourceNotFoundException to NotFoundException to match the names the API uses. [BREAKING]Contentful\Query into an abstract class to promote separation between CDA and CMA SDKs. [BREAKING]getQueryData() and getQueryString() from the various query classes. [BREAKING]FilesystemCache would try to read cached content types from the wrong file name.CacheWarmer wrote incorrect data for content types.Accept header for API versioning. Previously the Content-Type header was set instead.LogEntry would fail if no response has been set.ATTENTION: This release contains breaking changes. Please take extra care when updating to this version.
ATTENTION: This release contains breaking changes. Please take extra care when updating to this version.
webp format in the Images API.RateLimitExceededException, InvalidQueryException and AccessTokenInvalidException for more specific error handling. [BREAKING]Client.'*'' when creating the client. This could look
like: new Client($token, $spaceID, false, null, ['defaultLocale => '*'])select operator can now be specified on queries. Thanks @Haehnchen.all operator and passing arrays as $value in Query::where().Asset and Entry instances. [BREAKING]Contentful\Delivery\Client. Several options are now in an options array. [BREAKING]composer install --prefer-source.BearerToken to make it easier to inject custom Guzzle instances. Thanks @Haehnchen. [BREAKING]null are now treated like they don't exist. Previously they might have causes a
fatal error. Note: This does not 100% match the behaviour of the Contentful API.Query::setLimit was incorrect.Raised the minimum Guzzle version to 6.2.1. This version addressed the HTTP_PROXY security vulnerability (CVE-2016-5385).
Made LogEntry implement Serializable.
Implemented missing functionality of the Contentful Images API in ImageOptions.
startSync was type hinted to the wrong Query class.The ability to log information about requests made against the Contentful API.
Send a User-Agent header with API requests.
Initial release
Initial release
Your coding agent can read these notes before it upgrades. Set up the MCP server →