Canonical Pattern For CMS/BFF¶
Purpose¶
This document codifies the required CMS/BFF pattern for content objects used by headless site scaffolding.
The goal is to keep object persistence concerns inside CMS/BFF, while allowing site/page intent and front-end delivery concerns to remain separate.
Required Pattern¶
- For every content object, the BFF should:
- expose a canonical immutable identifier
- expose a 6-digit hash tag derived from the underlying object ID
-
support a client-supplied
slugfield as part of the content -
Return the full article content fields needed by pages:
tagscategoriesexcerpt-
featureImageUrl -
Author object consists of two fields:
- a string for
name -
an
authorKeyfield referencing the underlying author identity -
Article collections must be first-class objects.
-
Return article collections with these fields:
collectionKeynamedescriptionscope-
imageUrl -
Article collections must expose membership as an ordered array of stable article references, for example
[articleKey1, articleKey2, ...].
Boundary Rule¶
The following are not article-collection concerns and should not be pushed into the collection object:
- hero eyebrow
- hero title
- hero description
- grid heading
- grid description
These belong to site/page presentation intent, not to headless CMS object design.
Rationale¶
- canonical identifiers support stable persistence and reference
- hash tags support compact object shorthand
- slugs support readable delivery concerns
- collections should represent reusable content grouping
- page presentation remains a separate concern owned by site/page intent