<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Shapio blog</title><description>Guides for building on Shapio, and arguments about how a CMS should work. Releases live in the changelog.</description><link>https://shapio.dev/blog/</link><language>en</language><item><title>Rename the field. Nothing breaks.</title><link>https://shapio.dev/blog/rename-the-field-nothing-breaks/</link><guid isPermaLink="true">https://shapio.dev/blog/rename-the-field-nothing-breaks/</guid><description>Shapio 0.9.0: rename a field, change its type, or rework a content type, and every site and app you already shipped keeps working. None of them even find out.</description><pubDate>Fri, 13 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Every content model that has been in production long enough has a field called &lt;code&gt;description_new_FINAL&lt;/code&gt;. You know the one. It sits right next to &lt;code&gt;description&lt;/code&gt;, which nobody uses, and &lt;code&gt;description_new&lt;/code&gt;, which nobody admits to writing. All three are still there because something, somewhere, might read them, and nobody wants to be the person who finds out what.&lt;/p&gt;&lt;p&gt;Changing the model takes a minute. Changing everything that reads it takes forever. The website reads it. The iPhone app reads it. Last spring&amp;#39;s iPhone app reads it too, because some people treat the update button as a suggestion. So does a partner&amp;#39;s integration you will never see. Rename one field and all of them break in the same second.&lt;/p&gt;&lt;p&gt;So the standard advice is: don&amp;#39;t. Add the new field next to the old one, move every reader, wait, then clean up. The waiting is a guess. The cleanup is the step that never happens. Hence &lt;code&gt;description_new_FINAL&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;In Shapio 0.9.0 you just rename it, and the stuff you already shipped keeps working. That&amp;#39;s the whole announcement. The rest of this post is the proof, and where the idea came from.&lt;/p&gt;&lt;p&gt;I didn&amp;#39;t invent the trick. Shapio keeps stealing from computer science, on purpose, because most of the hard problems in a CMS were solved somewhere else years ago. Schema changes work like git: pull, apply, and a refused push when someone else got there first. Snapshots come from databases: a build reads the content as it stood at one moment, while editors keep publishing.&lt;/p&gt;&lt;p&gt;This one comes from a 2005 programming-languages paper about lenses: one set of data, seen in more than one shape, with the translation worked out for you. In 2021, a research lab used lenses to let old and new versions of an app share the same data. As far as I can tell, nobody had brought the idea to a CMS, where it is badly needed. So I did.&lt;/p&gt;&lt;h2 id=&quot;watch-it-not-break&quot;&gt;Watch it not break&lt;/h2&gt;&lt;p&gt;Here&amp;#39;s an article with a &lt;code&gt;teaser&lt;/code&gt; and a &lt;code&gt;readingTime&lt;/code&gt; in minutes. A website was built against it and deployed. Then I renamed &lt;code&gt;teaser&lt;/code&gt; to &lt;code&gt;excerpt&lt;/code&gt;, because that&amp;#39;s what it is, and changed &lt;code&gt;readingTime&lt;/code&gt; from a number to text, because an editor wanted to write &amp;quot;about 5&amp;quot; and editors deserve nice things. Both changes went live from the admin. No restart, no deploy.&lt;/p&gt;&lt;p&gt;A site built today asks for the new fields and gets them. This is a real response, trimmed to the parts that matter:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;title&amp;quot;: &amp;quot;Why builds pin a snapshot&amp;quot;,
  &amp;quot;excerpt&amp;quot;: &amp;quot;One number per build, so a publish never lands halfway.&amp;quot;,
  &amp;quot;readingTime&amp;quot;: &amp;quot;4&amp;quot;
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The website that was already deployed sends the exact request it has always sent, asking for &lt;code&gt;teaser&lt;/code&gt;. Here&amp;#39;s what it gets:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;title&amp;quot;: &amp;quot;Why builds pin a snapshot&amp;quot;,
  &amp;quot;teaser&amp;quot;: &amp;quot;One number per build, so a publish never lands halfway.&amp;quot;,
  &amp;quot;readingTime&amp;quot;: 4
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Old name. Old type. Today&amp;#39;s content. Edit the article and both sites show the edit, each in the shape it expects. The old site has no idea anything happened.&lt;/p&gt;&lt;h2 id=&quot;how-the-old-site-knows-what-it-wants&quot;&gt;How the old site knows what it wants&lt;/h2&gt;&lt;p&gt;Every site or app tells Shapio which version of the model it was built against. You never type it. The types Shapio generates for your project carry the version, and the client sends it along:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-ts&quot;&gt;export const shapio = createClient({
  baseUrl: process.env.SHAPIO_URL!,
  token: process.env.SHAPIO_DELIVERY_TOKEN,
  schemaVersion: SCHEMA_VERSION,
});&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Shapio keeps every version of every content type, so it hands each build today&amp;#39;s content in the shape it was built for, over REST and GraphQL. The Astro, Next.js, and SvelteKit starters are already wired for it.&lt;/p&gt;&lt;p&gt;When you want the new shape, regenerate the types, fix whatever the compiler complains about, and deploy. On your schedule, not the rename&amp;#39;s.&lt;/p&gt;&lt;h2 id=&quot;the-app-you-can-t-touch&quot;&gt;The app you can&amp;#39;t touch&lt;/h2&gt;&lt;p&gt;Some things can&amp;#39;t be rebuilt. The app already on phones. A kiosk in a lobby. Your uncle&amp;#39;s phone, still running a version from two years ago because he turned off updates in 2024 and considers the matter closed. For those, you pin the API token to a version. One click, in Settings.&lt;/p&gt;&lt;img src=&quot;https://itsasite.com/api/media/f/public/c9b3471b-6c78-481e-93a2-f135f1ebf425/a0245600d530d7459bb21dae/token-pin.png&quot; alt=&quot;Editing the API token &amp;quot;iOS app 2.3&amp;quot;: its schema version is 1, with a button to pin it to the current version, 4&quot;&gt;&lt;p&gt;From then on, everything that token reads comes back in that version&amp;#39;s shape, and the app doesn&amp;#39;t change at all. Pin the token when you ship, and that build has a contract that actually holds.&lt;/p&gt;&lt;h2 id=&quot;the-few-things-it-won-t-hide&quot;&gt;The few things it won&amp;#39;t hide&lt;/h2&gt;&lt;p&gt;A few things do show through. Delete a field and it&amp;#39;s deleted: an old app reads it as empty, because Shapio will not conjure data that no longer exists. Turning localization or drafts on or off, or switching a type between a collection and a single, shows through too. And an old client can&amp;#39;t filter or sort on a field whose type changed. Shapio refuses instead of guessing.&lt;/p&gt;&lt;p&gt;The good news is you find out first. Changes go through a review that tells you what older sites and apps will see, and which ones are still out there.&lt;/p&gt;&lt;img src=&quot;https://itsasite.com/api/media/f/public/3b8bf94e-dd32-4c65-a406-865402e99f9c/dea16ed88ea1112938bdba5f/change-set-review.png&quot; alt=&quot;A change set&amp;#39;s readers on older schema versions: Website build and iOS app 2.3 (pinned), both on version 1, with fields empty once it ships&quot;&gt;&lt;p&gt;&amp;quot;What still reads this field?&amp;quot; used to get a shrug. Now it gets a screen with names on it.&lt;/p&gt;&lt;h2 id=&quot;it-isn-t-a-back-door&quot;&gt;It isn&amp;#39;t a back door&lt;/h2&gt;&lt;p&gt;I work in security, so this is the part I was fussiest about. An API that can answer in an old shape is an API with a second way in, and that&amp;#39;s where data walks out the door. So a version changes how a response looks, never who may read what. Make a field private and it reads empty in every version, the old ones included. Delete a field and no version brings it back. Someone who isn&amp;#39;t allowed to read your content gets the same &amp;quot;no&amp;quot; whether they ask for today&amp;#39;s version, an old one, or a version number that never existed. Asking for a version tells them nothing. Old shapes, current rules, every time.&lt;/p&gt;&lt;h2 id=&quot;why-this-works-here&quot;&gt;Why this works here&lt;/h2&gt;&lt;p&gt;In Shapio, a content model is data, not code, and every field has a permanent ID that survives renames. Content is stored by that ID. So an old version of a model is just another set of labels on the same content, and Shapio works out the translation on every request.&lt;/p&gt;&lt;p&gt;The closest thing I know of is Stripe. Stripe pins your account to the API version you built against, and its engineers hand-write a transformation for every breaking change they make to their own API. Great deal, if you are Stripe. Shapio gives you the same deal for a model you change yourself, from an admin screen, with no transformation to write.&lt;/p&gt;&lt;p&gt;I looked for this in other headless CMSs and didn&amp;#39;t find it. What they tell you to do is what I described at the top: keep the old field and the new one side by side, move everything that reads them over, and clean up later. If one of them does have it, tell me and I&amp;#39;ll happily correct this.&lt;/p&gt;&lt;h2 id=&quot;go-rename-something&quot;&gt;Go rename something&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;npm install @shapio/cms@0.9.0&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The Docker image is tagged &lt;code&gt;0.9.0&lt;/code&gt;, and the docs cover the details under Schema lenses. Then go find your &lt;code&gt;description_new_FINAL&lt;/code&gt; and give it a real name. Your shipped apps won&amp;#39;t notice.&lt;/p&gt;</content:encoded><category>Announcement</category></item><item><title>Your content, your model, your keys</title><link>https://shapio.dev/blog/your-content-your-model-your-keys/</link><guid isPermaLink="true">https://shapio.dev/blog/your-content-your-model-your-keys/</guid><description>Shapio 0.8.0 adds Write, Suggest, and Fill in… to assist. All of it runs on a model provider you configure with your own key, or on a model on your own hardware, with a record of every run and nothing published by a model.</description><pubDate>Wed, 04 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A user runs a help center on Shapio. A few hundred articles, a search keywords field that most of the old ones never got, and an SEO description that is empty on half of them. They would like a model to draft those values. They would not like a CMS vendor&amp;#39;s servers to read every unpublished article to do it, and they would not like their editors&amp;#39; work to depend on a vendor&amp;#39;s AI subscription.&lt;/p&gt;&lt;p&gt;That second part is the whole design of assist in Shapio, and 0.8.0 makes it worth talking about: assist now writes, suggests, and fills, not just rewrites. Here is what shipped, and why the keys stay in your hands.&lt;/p&gt;&lt;h2 id=&quot;whose-model-it-is&quot;&gt;Whose model it is&lt;/h2&gt;&lt;p&gt;Open Shapio and assist is off. Not hidden behind a plan, off: the endpoints don&amp;#39;t exist, every assist control in the admin is absent, and nothing is sent anywhere. A test in the suite checks that on every build.&lt;/p&gt;&lt;p&gt;Turning it on is three environment variables on your own server:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;AI_PROVIDER=anthropic   # or openai, or openai-compatible
AI_MODEL=&amp;lt;the model your provider expects&amp;gt;
AI_API_KEY=&amp;lt;your key&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;AI_PROVIDER=anthropic&lt;/code&gt; with a key from your Anthropic console sends requests straight from your server to Anthropic&amp;#39;s Messages API, with the model you name. &lt;code&gt;AI_PROVIDER=openai&lt;/code&gt; with a key from your OpenAI account does the same against Chat Completions. Your account, your usage, your bill, and nobody in between. The third option, &lt;code&gt;openai-compatible&lt;/code&gt;, points &lt;code&gt;AI_BASE_URL&lt;/code&gt; at Ollama, LM Studio, vLLM, or a proxy you run, so the model can sit on hardware you own and nothing leaves your network. In every case the key is read from the environment only. The admin never shows it and has no field to type it into.&lt;/p&gt;&lt;p&gt;Setting them is one of the few things in Shapio that takes a restart. Content models change live in production, and so do roles, webhooks, and change sets, but a model provider is operator configuration, read once at boot, on purpose: no admin can switch where your content is sent by editing a settings page.&lt;/p&gt;&lt;p&gt;The rest of the contract is just as plain:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Only what the action needs is sent.&lt;/strong&gt; A suggestion sends the entry&amp;#39;s title and text values and the target field&amp;#39;s label and limits. A write sends the text around the cursor. A rewrite sends the selection and the instruction. The &lt;a href=&quot;https://github.com/mybrokengnome/shapio/blob/main/documentation/assist.md#what-is-sent-to-the-provider&quot;&gt;assist documentation&lt;/a&gt; lists it per action.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;It goes to your provider and nobody else.&lt;/strong&gt; Private media and fields marked not public are sent only to the provider you configured, and only when the person asking may read them. If your policy doesn&amp;#39;t allow that for some content, use a local model, or leave assist off.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Content is data, not instructions.&lt;/strong&gt; Text written by people goes to the model inside a delimited block the model is told to treat as material to work on. A sentence like &amp;quot;ignore your instructions&amp;quot; inside an article stays a sentence.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Shapio keeps a record, not the text.&lt;/strong&gt; Every run writes one row: who, which action, provider and model, token counts, duration, outcome. No prompt or answer is stored. The audit log gets the same event with the IDs involved, and accepting a fill is its own audit event with the entry, its fields, and the change set.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;People ship.&lt;/strong&gt; Every result is a proposal for a person to review. Nothing is ever published by assist.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This is a different arrangement from the one that is becoming common. Strapi&amp;#39;s AI features, going by &lt;a href=&quot;https://docs.strapi.io/cms/features&quot;&gt;Strapi&amp;#39;s own plan page&lt;/a&gt; as of today, are not in the open-source core at all. On the Growth plan they run as Strapi AI on Strapi&amp;#39;s infrastructure, metered in credits. Bringing your own key takes the Enterprise plan plus a paid Strapi AI Enterprise add-on, and even then it covers translations and media metadata, while the content-type assistant stays on Strapi&amp;#39;s side. Different products make different trade-offs. For a team whose unpublished content is the thing they are protecting, this one matters.&lt;/p&gt;&lt;h2 id=&quot;what-0-8-0-adds&quot;&gt;What 0.8.0 adds&lt;/h2&gt;&lt;p&gt;Three things, all of them proposals.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Write… and Continue writing.&lt;/strong&gt; In a rich-text document, the &lt;code&gt;/&lt;/code&gt; menu, the &lt;code&gt;+&lt;/code&gt; block menu, and the form editor&amp;#39;s toolbar have an Assist group. Write… asks what to write (&amp;quot;a section on pricing&amp;quot;); Continue writing picks up where the text stops. The answer opens beside the document as editable rich text, formatted with the same toolbar. Insert puts it in as real headings, paragraphs, and lists at the place you started, which follows your edits in the meantime. Discard throws it away. Escape or a click outside asks first when the proposal has text.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Suggest.&lt;/strong&gt; Point at any string or text field, the title and the SEO fields included, and Suggest appears under it. It writes a value from the rest of the entry, shaped by the field&amp;#39;s label, help text, and limits: search keywords from the article, an SEO description that aims at 160 characters without being cut, a short title. It fills the field as an ordinary unsaved edit, and you save when it reads right.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Fill in…&lt;/strong&gt; At the top of a content type&amp;#39;s list, pick a field and a model proposes a value for every entry where it is empty, up to 50 per run, in the list&amp;#39;s locale. The Inbox&amp;#39;s &amp;quot;Required fields left empty&amp;quot; group gets the same thing as Propose fixes. The proposals open in a review sheet, grouped by entry: edit a value, reject a field, and Accept saves the rest into the entry&amp;#39;s draft and adds the entry to one change set opened for the run. An entry that already had unpublished edits, or was never published, is saved as a draft but left out of the set, with the reason shown, so shipping the set never publishes more than the fill. Nothing goes live until someone ships it.&lt;/p&gt;&lt;p&gt;For the help center above, that is: make Search keywords required, let the Inbox list the articles without one, run Propose fixes, read through the proposals, and ship the change set. The articles the model got wrong get a corrected value or a rejection, and the whole thing is one reviewed change in the history, attributed to the person who accepted it.&lt;/p&gt;&lt;h2 id=&quot;what-is-not-there&quot;&gt;What is not there&lt;/h2&gt;&lt;p&gt;No streaming, so each answer arrives in one piece within the timeout you set. No images, tables, or links are ever written by a model. Enums, numbers, dates, slugs, media, and relations get no suggestion in the admin. Assist needs no Shapio account, no hosted service, and no telemetry; nothing leaves your server unless you configured a provider for it to go to.&lt;/p&gt;&lt;p&gt;Assist write and fill is in &lt;a href=&quot;https://github.com/mybrokengnome/shapio/blob/main/CHANGELOG.md#080---2026-11-04&quot;&gt;0.8.0&lt;/a&gt;. The &lt;a href=&quot;https://github.com/mybrokengnome/shapio/blob/main/documentation/assist.md&quot;&gt;assist documentation&lt;/a&gt; has the setup for Anthropic, OpenAI, and a local model, the table of what each action sends, and every endpoint.&lt;/p&gt;</content:encoded><category>Announcement</category></item><item><title>One list, four content types</title><link>https://shapio.dev/blog/one-list-four-content-types/</link><guid isPermaLink="true">https://shapio.dev/blog/one-list-four-content-types/</guid><description>Shapio 0.6.0 adds interfaces: a contract of fields that unrelated types promise to have. One relation on the shapio.dev homepage now holds a blog post, a comparison, a roadmap item, and another post, and one route lists them all.</description><pubDate>Thu, 22 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Every homepage has a strip of three or four cards that someone picks by hand. On shapio.dev this week it&amp;#39;s the post about subtypes, the Shapio vs Strapi comparison, the Interfaces roadmap item, and a post about webhook signatures. Three content types, four cards, one list.&lt;/p&gt;&lt;p&gt;In most headless CMSs that list is a problem. A relation field points at one content type. So you get a field per type (which fixes the layout), or a &amp;quot;card&amp;quot; component where someone retypes the title, the summary, and the link, which goes stale the day the post is renamed.&lt;/p&gt;&lt;p&gt;Shapio 0.6.0 adds interfaces, so one field can hold all four, and the site can render each card without knowing what type it is. It&amp;#39;s the second half of something we started in 0.5.9, when a type could first &lt;a href=&quot;/blog/your-content-has-subtypes/&quot;&gt;extend another type&lt;/a&gt;. Together they make a content model that works the way a type system does, and I&amp;#39;ll come back to why that matters at the end.&lt;/p&gt;&lt;h2 id=&quot;what-an-interface-is&quot;&gt;What an interface is&lt;/h2&gt;&lt;p&gt;An interface is a contract: the fields every member must have. It stores nothing. A content type says which interfaces it implements, and Shapio checks that the type has every contract field, matched by API ID and type.&lt;/p&gt;&lt;p&gt;Here&amp;#39;s &lt;code&gt;Featurable&lt;/code&gt;, the interface behind shapio.dev&amp;#39;s homepage, exactly as &lt;code&gt;shapio schema pull&lt;/code&gt; writes it to &lt;code&gt;interfaces/featurable.json&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;apiKey&amp;quot;: &amp;quot;featurable&amp;quot;,
  &amp;quot;description&amp;quot;: &amp;quot;Anything the homepage can feature: a title and a summary.&amp;quot;,
  &amp;quot;display&amp;quot;: {
    &amp;quot;defaultSort&amp;quot;: {
      &amp;quot;direction&amp;quot;: &amp;quot;asc&amp;quot;,
      &amp;quot;fieldId&amp;quot;: &amp;quot;311ac6f2-6f02-4028-aa6b-7ada9d7410da&amp;quot;
    },
    &amp;quot;titleFieldId&amp;quot;: &amp;quot;311ac6f2-6f02-4028-aa6b-7ada9d7410da&amp;quot;
  },
  &amp;quot;fields&amp;quot;: [
    {
      &amp;quot;apiKey&amp;quot;: &amp;quot;title&amp;quot;,
      &amp;quot;filterable&amp;quot;: true,
      &amp;quot;id&amp;quot;: &amp;quot;311ac6f2-6f02-4028-aa6b-7ada9d7410da&amp;quot;,
      &amp;quot;label&amp;quot;: &amp;quot;Title&amp;quot;,
      &amp;quot;localized&amp;quot;: false,
      &amp;quot;public&amp;quot;: true,
      &amp;quot;required&amp;quot;: true,
      &amp;quot;settings&amp;quot;: {},
      &amp;quot;sortable&amp;quot;: true,
      &amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;,
      &amp;quot;unique&amp;quot;: false
    },
    {
      &amp;quot;apiKey&amp;quot;: &amp;quot;summary&amp;quot;,
      &amp;quot;filterable&amp;quot;: false,
      &amp;quot;id&amp;quot;: &amp;quot;a0585365-ac3c-4a28-a1cd-19e05c8920e6&amp;quot;,
      &amp;quot;label&amp;quot;: &amp;quot;Summary&amp;quot;,
      &amp;quot;localized&amp;quot;: false,
      &amp;quot;public&amp;quot;: true,
      &amp;quot;required&amp;quot;: false,
      &amp;quot;settings&amp;quot;: {},
      &amp;quot;sortable&amp;quot;: false,
      &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,
      &amp;quot;unique&amp;quot;: false
    }
  ],
  &amp;quot;id&amp;quot;: &amp;quot;06cc67d9-b714-40ac-9bf7-bf4bd41576fe&amp;quot;,
  &amp;quot;kind&amp;quot;: &amp;quot;interface&amp;quot;,
  &amp;quot;label&amp;quot;: &amp;quot;Featurable&amp;quot;,
  &amp;quot;pluralApiKey&amp;quot;: &amp;quot;featurables&amp;quot;
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Two fields: a title and a summary. Every type that implements it must have both, with the same types and the same flags. &lt;code&gt;title&lt;/code&gt; is required, public, filterable, and sortable on the contract, so it must be all four on every member.&lt;/p&gt;&lt;p&gt;Because fields match by API ID, we had one thing to fix first. Blog posts, comparisons, and pages called their summary &lt;code&gt;standfirst&lt;/code&gt;, &lt;code&gt;lede&lt;/code&gt;, and &lt;code&gt;description&lt;/code&gt;, so we renamed all three to &lt;code&gt;summary&lt;/code&gt;. A rename changes the API ID, not the data, so no post lost its summary.&lt;/p&gt;&lt;p&gt;A type implements an interface under &lt;strong&gt;Implements&lt;/strong&gt; in the builder, or with one line in its file. The top-level keys of &lt;code&gt;models/blogPost.json&lt;/code&gt;, with &lt;code&gt;fields&lt;/code&gt; and &lt;code&gt;display&lt;/code&gt; left out:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;apiKey&amp;quot;: &amp;quot;blogPost&amp;quot;,
  &amp;quot;description&amp;quot;: &amp;quot;A shapio.dev blog post (/blog/{slug}/): a guide or an opinion piece, with a summary, a body, an optional cover, the frameworks it works with and related posts.&amp;quot;,
  &amp;quot;draftAndPublish&amp;quot;: true,
  &amp;quot;id&amp;quot;: &amp;quot;46b3ffe2-13a9-4786-903b-29b5fb924107&amp;quot;,
  &amp;quot;implements&amp;quot;: [
    &amp;quot;06cc67d9-b714-40ac-9bf7-bf4bd41576fe&amp;quot;
  ],
  &amp;quot;kind&amp;quot;: &amp;quot;collection&amp;quot;,
  &amp;quot;label&amp;quot;: &amp;quot;Blog post&amp;quot;,
  &amp;quot;localized&amp;quot;: false,
  &amp;quot;pluralApiKey&amp;quot;: &amp;quot;blogPosts&amp;quot;
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;BlogPost, RoadmapItem, Comparison, and Page all implement Featurable. A kind inherits what its parent implements, so a type that &lt;a href=&quot;/blog/your-content-has-subtypes/&quot;&gt;extends&lt;/a&gt; BlogPost would be Featurable too without saying so. Single types can be members as well.&lt;/p&gt;&lt;p&gt;Nothing changes about storage. Each type keeps its own fields and its own field IDs. The interface only says which fields line up.&lt;/p&gt;&lt;h2 id=&quot;one-list-across-four-types&quot;&gt;One list across four types&lt;/h2&gt;&lt;p&gt;An interface gets a route of its own. &lt;code&gt;GET /api/content/featurables&lt;/code&gt; lists every member&amp;#39;s entries in one page. Here it is against our hub, with shapio.dev&amp;#39;s delivery token:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;curl -H &amp;quot;Authorization: Bearer $SHAPIO_DELIVERY_TOKEN&amp;quot; \
  &amp;quot;$SHAPIO_URL/api/content/featurables?sort=title&amp;amp;fields=title,summary&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;data&amp;quot;: [
    {
      &amp;quot;id&amp;quot;: &amp;quot;761d3bc2-fc74-4cd2-8f2a-3204e1fd6e83&amp;quot;,
      &amp;quot;__model&amp;quot;: &amp;quot;roadmapItem&amp;quot;,
      &amp;quot;__kinds&amp;quot;: [&amp;quot;roadmapItem&amp;quot;],
      &amp;quot;locale&amp;quot;: &amp;quot;en&amp;quot;,
      &amp;quot;createdAt&amp;quot;: &amp;quot;2026-10-05T01:22:35.000Z&amp;quot;,
      &amp;quot;updatedAt&amp;quot;: &amp;quot;2026-10-07T11:09:19.272Z&amp;quot;,
      &amp;quot;publishedAt&amp;quot;: &amp;quot;2026-10-07T11:09:19.272Z&amp;quot;,
      &amp;quot;title&amp;quot;: &amp;quot;A GraphQL schema per site&amp;quot;,
      &amp;quot;summary&amp;quot;: &amp;quot;The GraphQL endpoint answers with the requesting site&amp;#39;s schema: its own content types plus the shared ones.&amp;quot;
    },
    {
      &amp;quot;id&amp;quot;: &amp;quot;61655d1e-edcc-46ba-b545-70c418249cb5&amp;quot;,
      &amp;quot;__model&amp;quot;: &amp;quot;roadmapItem&amp;quot;,
      &amp;quot;__kinds&amp;quot;: [&amp;quot;roadmapItem&amp;quot;],
      &amp;quot;locale&amp;quot;: &amp;quot;en&amp;quot;,
      &amp;quot;createdAt&amp;quot;: &amp;quot;2026-10-05T01:22:24.246Z&amp;quot;,
      &amp;quot;updatedAt&amp;quot;: &amp;quot;2026-10-07T11:09:13.193Z&amp;quot;,
      &amp;quot;publishedAt&amp;quot;: &amp;quot;2026-10-07T11:09:13.193Z&amp;quot;,
      &amp;quot;title&amp;quot;: &amp;quot;A clearer entry editor&amp;quot;,
      &amp;quot;summary&amp;quot;: &amp;quot;Every document field shows its heading, an empty list shows an Add row, and the SEO group is always in the strip.&amp;quot;
    },
    &amp;quot;… 23 more rows on this page: 18 roadmap items and five blog posts&amp;quot;
  ],
  &amp;quot;meta&amp;quot;: {
    &amp;quot;locale&amp;quot;: &amp;quot;en&amp;quot;,
    &amp;quot;snapshot&amp;quot;: 722,
    &amp;quot;pagination&amp;quot;: { &amp;quot;page&amp;quot;: 1, &amp;quot;pageSize&amp;quot;: 25, &amp;quot;total&amp;quot;: 84, &amp;quot;pageCount&amp;quot;: 4 },
    &amp;quot;members&amp;quot;: [
      { &amp;quot;apiKey&amp;quot;: &amp;quot;page&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Page&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;pages&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;roadmapItem&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Roadmap item&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;roadmapItems&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;comparison&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Comparison&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;comparisons&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;blogPost&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Blog post&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;blogPosts&amp;quot; }
    ]
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Every row says which type it is in &lt;code&gt;__model&lt;/code&gt;, and without &lt;code&gt;fields=&lt;/code&gt; each row comes back in its own type&amp;#39;s full shape: a roadmap item carries its &lt;code&gt;stage&lt;/code&gt;, a blog post its &lt;code&gt;category&lt;/code&gt;. &lt;code&gt;meta.members&lt;/code&gt; lists the member types your token may read, so a site can build a type filter without reading the schema.&lt;/p&gt;&lt;p&gt;The list filters, sorts, and searches on the contract fields. &lt;code&gt;sort=title&lt;/code&gt; sorts across four types, each using its own index, because the contract said &lt;code&gt;title&lt;/code&gt; is sortable on every member. A field that isn&amp;#39;t in the contract can&amp;#39;t be used here, since not every row has it.&lt;/p&gt;&lt;p&gt;A token that may read only blog posts gets only the blog posts, and &lt;code&gt;meta.members&lt;/code&gt; shrinks to match. No type is ever shown to someone who can&amp;#39;t read it.&lt;/p&gt;&lt;h2 id=&quot;the-relation&quot;&gt;The relation&lt;/h2&gt;&lt;p&gt;The homepage has one field, &lt;code&gt;featured&lt;/code&gt;, a relation to Featurable that holds up to four entries. It accepts an entry of any member, and the picker in the admin searches across all of them, with a type filter.&lt;/p&gt;&lt;p&gt;Populated, each target comes back in its own shape. Here&amp;#39;s the homepage with the four cards from the top of this post, trimmed to the fields a card needs:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;curl -H &amp;quot;Authorization: Bearer $SHAPIO_DELIVERY_TOKEN&amp;quot; \
  &amp;quot;$SHAPIO_URL/api/content/shapioDevHome?populate=featured&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;data&amp;quot;: {
    &amp;quot;__model&amp;quot;: &amp;quot;shapioDevHome&amp;quot;,
    &amp;quot;heroTitle&amp;quot;: &amp;quot;Shape your\ncontent.\nYour API\nfollows.&amp;quot;,
    &amp;quot;…&amp;quot;: &amp;quot;…&amp;quot;,
    &amp;quot;featured&amp;quot;: [
      { &amp;quot;__model&amp;quot;: &amp;quot;blogPost&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Your content has subtypes. Your CMS should too.&amp;quot;, &amp;quot;slug&amp;quot;: &amp;quot;your-content-has-subtypes&amp;quot;, &amp;quot;category&amp;quot;: &amp;quot;announcement&amp;quot;, &amp;quot;…&amp;quot;: &amp;quot;…&amp;quot; },
      { &amp;quot;__model&amp;quot;: &amp;quot;comparison&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Shapio vs Strapi&amp;quot;, &amp;quot;slug&amp;quot;: &amp;quot;strapi&amp;quot;, &amp;quot;competitor&amp;quot;: &amp;quot;Strapi&amp;quot;, &amp;quot;…&amp;quot;: &amp;quot;…&amp;quot; },
      { &amp;quot;__model&amp;quot;: &amp;quot;roadmapItem&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Interfaces&amp;quot;, &amp;quot;stage&amp;quot;: &amp;quot;shipped&amp;quot;, &amp;quot;release&amp;quot;: &amp;quot;0.6.0&amp;quot;, &amp;quot;…&amp;quot;: &amp;quot;…&amp;quot; },
      { &amp;quot;__model&amp;quot;: &amp;quot;blogPost&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;A shared token isn’t a signature&amp;quot;, &amp;quot;slug&amp;quot;: &amp;quot;a-shared-token-isnt-a-signature&amp;quot;, &amp;quot;category&amp;quot;: &amp;quot;guide&amp;quot;, &amp;quot;…&amp;quot;: &amp;quot;…&amp;quot; }
    ]
  },
  &amp;quot;meta&amp;quot;: { &amp;quot;locale&amp;quot;: &amp;quot;en&amp;quot;, &amp;quot;snapshot&amp;quot;: 722 }
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Rendering a card is a function of the two contract fields, plus &lt;code&gt;__model&lt;/code&gt; for the link. This is the whole thing, with the same links shapio.dev uses, run with Node against our hub:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const headers = { Authorization: `Bearer ${process.env.SHAPIO_DELIVERY_TOKEN}` };
const url = `${process.env.SHAPIO_URL}/api/content/shapioDevHome?populate=featured`;
const home = await fetch(url, { headers }).then((r) =&amp;gt; r.json());

const href = {
  blogPost: (e) =&amp;gt; `/blog/${e.slug}/`,
  comparison: (e) =&amp;gt; `/compare/${e.slug}/`,
  page: (e) =&amp;gt; `/${e.slug}/`,
  roadmapItem: () =&amp;gt; &amp;#39;/roadmap/&amp;#39;,
};

for (const entry of home.data.featured) {
  console.log({ title: entry.title, summary: entry.summary, href: href[entry.__model](entry) });
}&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;{
  title: &amp;#39;Your content has subtypes. Your CMS should too.&amp;#39;,
  summary: &amp;quot;Shapio 0.5.9 adds polymorphic content types. A content type can extend another, and its kinds inherit the parent&amp;#39;s fields, live in one list with it, and can be pointed at, granted, and changed as a family.&amp;quot;,
  href: &amp;#39;/blog/your-content-has-subtypes/&amp;#39;
}
{
  title: &amp;#39;Shapio vs Strapi&amp;#39;,
  summary: &amp;#39;Shapio and Strapi are both open-source, self-hosted headless CMSs with REST and GraphQL. The difference is how the content model changes, and how a site ships.&amp;#39;,
  href: &amp;#39;/compare/strapi/&amp;#39;
}
{
  title: &amp;#39;Interfaces&amp;#39;,
  summary: &amp;#39;A type can implement any number of interfaces, and a relation can point at an interface or at any entry. The Featured band on this site’s homepage holds a blog post, a comparison, and a roadmap item, even though they share no parent.&amp;#39;,
  href: &amp;#39;/roadmap/&amp;#39;
}
{
  title: &amp;#39;A shared token isn’t a signature&amp;#39;,
  summary: &amp;#39;Every Shapio webhook is signed, so your receiver can tell a real request from a forged, changed, or replayed one. Strapi sends a fixed token instead. Here’s the difference, with a real receiver and real attacks.&amp;#39;,
  href: &amp;#39;/blog/a-shared-token-isnt-a-signature/&amp;#39;
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Rename the blog post and the card updates. Add a fifth type to the strip next month, and the only change is one more line in &lt;code&gt;href&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;A relation can also point at &lt;strong&gt;any entry&lt;/strong&gt;. No contract, any collection or single type on the site. It&amp;#39;s for the cases where you really do mean anything: an audit record&amp;#39;s subject, a comment&amp;#39;s parent.&lt;/p&gt;&lt;h2 id=&quot;not-just-websites&quot;&gt;Not just websites&lt;/h2&gt;&lt;p&gt;A homepage strip is the easy case. The same shape shows up anywhere unrelated things need to be handled as one.&lt;/p&gt;&lt;p&gt;Take a game that keeps its items in Shapio. Weapons, armor, and potions are different types with different fields: a weapon has damage, armor has defense, a potion has an effect. What they share is what the inventory needs: a name, an icon, and a weight. So:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;apiKey&amp;quot;: &amp;quot;carryable&amp;quot;,
  &amp;quot;display&amp;quot;: {
    &amp;quot;defaultSort&amp;quot;: {
      &amp;quot;direction&amp;quot;: &amp;quot;asc&amp;quot;,
      &amp;quot;fieldId&amp;quot;: &amp;quot;4ca85bdd-5547-478a-9805-54523ea4b3cc&amp;quot;
    },
    &amp;quot;titleFieldId&amp;quot;: &amp;quot;0b3ef7e0-8b71-4195-95c8-529fc377868e&amp;quot;
  },
  &amp;quot;fields&amp;quot;: [
    {
      &amp;quot;apiKey&amp;quot;: &amp;quot;name&amp;quot;,
      &amp;quot;filterable&amp;quot;: true,
      &amp;quot;id&amp;quot;: &amp;quot;0b3ef7e0-8b71-4195-95c8-529fc377868e&amp;quot;,
      &amp;quot;label&amp;quot;: &amp;quot;Name&amp;quot;,
      &amp;quot;localized&amp;quot;: false,
      &amp;quot;public&amp;quot;: true,
      &amp;quot;required&amp;quot;: true,
      &amp;quot;settings&amp;quot;: {},
      &amp;quot;sortable&amp;quot;: true,
      &amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;,
      &amp;quot;unique&amp;quot;: false
    },
    {
      &amp;quot;apiKey&amp;quot;: &amp;quot;icon&amp;quot;,
      &amp;quot;filterable&amp;quot;: false,
      &amp;quot;id&amp;quot;: &amp;quot;78449d75-bba4-4029-9372-f72a3adfbdc6&amp;quot;,
      &amp;quot;label&amp;quot;: &amp;quot;Icon&amp;quot;,
      &amp;quot;localized&amp;quot;: false,
      &amp;quot;public&amp;quot;: true,
      &amp;quot;required&amp;quot;: false,
      &amp;quot;settings&amp;quot;: {
        &amp;quot;multiple&amp;quot;: false
      },
      &amp;quot;sortable&amp;quot;: false,
      &amp;quot;type&amp;quot;: &amp;quot;media&amp;quot;,
      &amp;quot;unique&amp;quot;: false
    },
    {
      &amp;quot;apiKey&amp;quot;: &amp;quot;weight&amp;quot;,
      &amp;quot;filterable&amp;quot;: true,
      &amp;quot;id&amp;quot;: &amp;quot;4ca85bdd-5547-478a-9805-54523ea4b3cc&amp;quot;,
      &amp;quot;label&amp;quot;: &amp;quot;Weight&amp;quot;,
      &amp;quot;localized&amp;quot;: false,
      &amp;quot;public&amp;quot;: true,
      &amp;quot;required&amp;quot;: true,
      &amp;quot;settings&amp;quot;: {},
      &amp;quot;sortable&amp;quot;: true,
      &amp;quot;type&amp;quot;: &amp;quot;integer&amp;quot;,
      &amp;quot;unique&amp;quot;: false
    }
  ],
  &amp;quot;id&amp;quot;: &amp;quot;9c6d1452-5e82-43ad-b868-2a416d5730a1&amp;quot;,
  &amp;quot;kind&amp;quot;: &amp;quot;interface&amp;quot;,
  &amp;quot;label&amp;quot;: &amp;quot;Carryable&amp;quot;,
  &amp;quot;pluralApiKey&amp;quot;: &amp;quot;carryables&amp;quot;
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Weapon, Armor, and Potion implement it. A Character has &lt;code&gt;inventory&lt;/code&gt;, a relation to Carryable, and the game client reads one list. Here it&amp;#39;s trimmed to the two fields the inventory screen sorts by; without &lt;code&gt;fields=&lt;/code&gt; each row carries its own &lt;code&gt;damage&lt;/code&gt;, &lt;code&gt;defense&lt;/code&gt;, or &lt;code&gt;effect&lt;/code&gt;, and &lt;code&gt;__model&lt;/code&gt; says which:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;curl -g -H &amp;quot;Authorization: Bearer $SHAPIO_DELIVERY_TOKEN&amp;quot; \
  &amp;quot;$SHAPIO_URL/api/content/carryables?filters[weight][\$lte]=5&amp;amp;sort=weight&amp;amp;fields=name,weight&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;data&amp;quot;: [
    {
      &amp;quot;id&amp;quot;: &amp;quot;80e456e4-5ec3-4f82-9ab3-d590e101a640&amp;quot;,
      &amp;quot;__model&amp;quot;: &amp;quot;potion&amp;quot;,
      &amp;quot;__kinds&amp;quot;: [&amp;quot;potion&amp;quot;],
      &amp;quot;locale&amp;quot;: &amp;quot;en&amp;quot;,
      &amp;quot;createdAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.483Z&amp;quot;,
      &amp;quot;updatedAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.489Z&amp;quot;,
      &amp;quot;publishedAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.489Z&amp;quot;,
      &amp;quot;name&amp;quot;: &amp;quot;Antidote&amp;quot;,
      &amp;quot;weight&amp;quot;: 1
    },
    {
      &amp;quot;id&amp;quot;: &amp;quot;c065fda7-1393-4f2c-aa16-abc1b1fb1944&amp;quot;,
      &amp;quot;__model&amp;quot;: &amp;quot;weapon&amp;quot;,
      &amp;quot;__kinds&amp;quot;: [&amp;quot;weapon&amp;quot;],
      &amp;quot;locale&amp;quot;: &amp;quot;en&amp;quot;,
      &amp;quot;createdAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.365Z&amp;quot;,
      &amp;quot;updatedAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.381Z&amp;quot;,
      &amp;quot;publishedAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.381Z&amp;quot;,
      &amp;quot;name&amp;quot;: &amp;quot;Dagger&amp;quot;,
      &amp;quot;weight&amp;quot;: 1
    },
    {
      &amp;quot;id&amp;quot;: &amp;quot;cfe723bd-cf80-4246-b849-f72029060405&amp;quot;,
      &amp;quot;__model&amp;quot;: &amp;quot;potion&amp;quot;,
      &amp;quot;__kinds&amp;quot;: [&amp;quot;potion&amp;quot;],
      &amp;quot;locale&amp;quot;: &amp;quot;en&amp;quot;,
      &amp;quot;createdAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.470Z&amp;quot;,
      &amp;quot;updatedAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.477Z&amp;quot;,
      &amp;quot;publishedAt&amp;quot;: &amp;quot;2026-10-22T15:40:41.477Z&amp;quot;,
      &amp;quot;name&amp;quot;: &amp;quot;Healing draught&amp;quot;,
      &amp;quot;weight&amp;quot;: 1
    },
    &amp;quot;… three more rows&amp;quot;
  ],
  &amp;quot;meta&amp;quot;: {
    &amp;quot;locale&amp;quot;: &amp;quot;en&amp;quot;,
    &amp;quot;snapshot&amp;quot;: 18,
    &amp;quot;pagination&amp;quot;: { &amp;quot;page&amp;quot;: 1, &amp;quot;pageSize&amp;quot;: 25, &amp;quot;total&amp;quot;: 6, &amp;quot;pageCount&amp;quot;: 1 },
    &amp;quot;members&amp;quot;: [
      { &amp;quot;apiKey&amp;quot;: &amp;quot;armor&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Armor&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;armors&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;weapon&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Weapon&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;weapons&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;potion&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Potion&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;potions&amp;quot; }
    ]
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That query is &amp;quot;everything light enough to pick up,&amp;quot; across three types, because the contract made &lt;code&gt;weight&lt;/code&gt; filterable and sortable on all of them. Add a fourth item type next season, mark it Carryable, and every inventory, shop, and loot table that points at Carryable accepts it, and lists it, the same day.&lt;/p&gt;&lt;p&gt;An app&amp;#39;s API works the same way. An activity feed holds orders, messages, and reminders; a &lt;code&gt;Notifiable&lt;/code&gt; interface with a title, a body, and a deep link gives the feed one relation and the mobile client one card component. Any entry that implements it can be listed, opened, and turned into a notification the same way, and the types stay free to carry their own fields underneath.&lt;/p&gt;&lt;h2 id=&quot;graphql&quot;&gt;GraphQL&lt;/h2&gt;&lt;p&gt;A Shapio interface is a GraphQL interface. &lt;code&gt;Featurable&lt;/code&gt; has the contract fields; a fragment gets you a member&amp;#39;s own fields:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-graphql&quot;&gt;{
  featurables(sort: [{ title: ASC }], pageSize: 6) {
    totalCount
    nodes {
      __typename
      title
      ... on RoadmapItem {
        stage
      }
      ... on BlogPost {
        category
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;data&amp;quot;: {
    &amp;quot;featurables&amp;quot;: {
      &amp;quot;totalCount&amp;quot;: 84,
      &amp;quot;nodes&amp;quot;: [
        {
          &amp;quot;__typename&amp;quot;: &amp;quot;RoadmapItem&amp;quot;,
          &amp;quot;title&amp;quot;: &amp;quot;A GraphQL schema per site&amp;quot;,
          &amp;quot;stage&amp;quot;: &amp;quot;shipped&amp;quot;
        },
        {
          &amp;quot;__typename&amp;quot;: &amp;quot;RoadmapItem&amp;quot;,
          &amp;quot;title&amp;quot;: &amp;quot;A clearer entry editor&amp;quot;,
          &amp;quot;stage&amp;quot;: &amp;quot;shipped&amp;quot;
        },
        {
          &amp;quot;__typename&amp;quot;: &amp;quot;RoadmapItem&amp;quot;,
          &amp;quot;title&amp;quot;: &amp;quot;A new brand&amp;quot;,
          &amp;quot;stage&amp;quot;: &amp;quot;shipped&amp;quot;
        },
        {
          &amp;quot;__typename&amp;quot;: &amp;quot;BlogPost&amp;quot;,
          &amp;quot;title&amp;quot;: &amp;quot;A product is not a blog post&amp;quot;,
          &amp;quot;category&amp;quot;: &amp;quot;announcement&amp;quot;
        },
        {
          &amp;quot;__typename&amp;quot;: &amp;quot;BlogPost&amp;quot;,
          &amp;quot;title&amp;quot;: &amp;quot;A shared token isn’t a signature&amp;quot;,
          &amp;quot;category&amp;quot;: &amp;quot;guide&amp;quot;
        },
        {
          &amp;quot;__typename&amp;quot;: &amp;quot;RoadmapItem&amp;quot;,
          &amp;quot;title&amp;quot;: &amp;quot;API tokens show when they expire&amp;quot;,
          &amp;quot;stage&amp;quot;: &amp;quot;shipped&amp;quot;
        }
      ]
    }
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Every schema now has an interface called &lt;code&gt;Entry&lt;/code&gt; with the system fields, which every type implements. A relation to any entry returns it.&lt;/p&gt;&lt;h2 id=&quot;what-shapio-enforces&quot;&gt;What Shapio enforces&lt;/h2&gt;&lt;p&gt;An interface is only useful if it&amp;#39;s true. So:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Breaking a contract is refused.&lt;/strong&gt; Rename, retype, or delete &lt;code&gt;title&lt;/code&gt; on BlogPost while it implements Featurable, and the builder refuses on the field, naming the interface. Drop Implements first, or keep the field.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adding to a contract offers the fix.&lt;/strong&gt; Add a &lt;code&gt;rating&lt;/code&gt; field to Featurable while no member has one, and the review lists the four types that lack it and offers to add the field to all of them in one change set. Nothing applies until every member complies.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Leaving an interface can&amp;#39;t strand a relation.&lt;/strong&gt; Remove Featurable from RoadmapItem while the homepage still features one, and the change is refused with the count. Remove the reference, then the type.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Widening a relation keeps its values.&lt;/strong&gt; Change a relation from pointing at BlogPost to pointing at Featurable, and every existing value is still valid, so they stay (it&amp;#39;s still a breaking change you acknowledge, because the field&amp;#39;s type changes for API clients). Narrowing it back clears them, with the usual destructive acknowledgement.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;All of this runs live, like every schema change in Shapio. No rebuild, no restart.&lt;/p&gt;&lt;h2 id=&quot;extends-implements-composed-of&quot;&gt;Extends, implements, composed of&lt;/h2&gt;&lt;p&gt;Step back and the shape is familiar. Since 0.5.9 a type can extend one parent: a kind inherits its parent&amp;#39;s fields, keeps the parent&amp;#39;s field IDs, and shows up in the parent&amp;#39;s list next to it. Since 0.6.0 a type can implement any number of interfaces: BlogPost, RoadmapItem, Comparison, and Page are all Featurable without sharing a parent. And since the beginning a type is composed of components and dynamic zones. One parent, many interfaces, composition. That is the object model of every mainstream programming language, applied to content, and each piece shows up the same way everywhere: REST, GraphQL, the generated TypeScript, the schema files, and the admin.&lt;/p&gt;&lt;p&gt;That is new for a headless CMS. &lt;a href=&quot;https://www.contentful.com/developers/docs/references/content-management-api/content-types/&quot;&gt;Contentful&lt;/a&gt; lets a reference accept several content types (&lt;code&gt;linkContentType&lt;/code&gt;), &lt;a href=&quot;https://www.sanity.io/docs/studio/schema-types&quot;&gt;Sanity&lt;/a&gt; lets a &lt;code&gt;reference&lt;/code&gt; list several &lt;code&gt;to&lt;/code&gt; types, and &lt;a href=&quot;https://hygraph.com/classic-docs/api-reference/schema/field-types&quot;&gt;Hygraph&lt;/a&gt; has union fields. All three solve the picker. None of them makes the types promise anything, so the site still has to know every type to render a card, and none of them has a type extend another. Strapi&amp;#39;s builder gives a relation one target type; its data layer has polymorphic relations, but Strapi &lt;a href=&quot;https://docs-v4.strapi.io/dev-docs/migration/v3-to-v4/data/sql-relations&quot;&gt;marks them non-configurable&lt;/a&gt; to keep them out of the admin.&lt;/p&gt;&lt;p&gt;The older, code-first CMSs did have this. Sitecore has &lt;a href=&quot;https://doc.sitecore.com/xmc/en/developers/xm-cloud/data-template-inheritance.html&quot;&gt;base templates&lt;/a&gt;, Optimizely&amp;#39;s content types are &lt;a href=&quot;https://docs.developers.optimizely.com/content-management-system/docs/content-types&quot;&gt;C# classes that inherit&lt;/a&gt; from a base class, and Umbraco has &lt;a href=&quot;https://docs.umbraco.com/umbraco-cms/17.latest/model-your-content/content-types-and-structure&quot;&gt;compositions&lt;/a&gt;. They have it because their content models are code, and that is also why changing one means a build and a deploy. Shapio&amp;#39;s models are data. Add an interface, make a type implement it, point a relation at it, and the API changes while the server runs. Nobody has had inheritance and interfaces that way before.&lt;/p&gt;&lt;p&gt;Interfaces are in 0.6.0. The &lt;a href=&quot;https://github.com/mybrokengnome/shapio/blob/main/CHANGELOG.md#060---2026-10-21&quot;&gt;changelog&lt;/a&gt; has the details, and &lt;a href=&quot;https://github.com/mybrokengnome/shapio/blob/main/documentation/modeling.md#interfaces&quot;&gt;Modeling&lt;/a&gt; has the rules.&lt;/p&gt;</content:encoded><category>Announcement</category></item><item><title>A shared token isn’t a signature</title><link>https://shapio.dev/blog/a-shared-token-isnt-a-signature/</link><guid isPermaLink="true">https://shapio.dev/blog/a-shared-token-isnt-a-signature/</guid><description>Every Shapio webhook is signed, so your receiver can tell a real request from a forged, changed, or replayed one. Strapi sends a fixed token instead. Here’s the difference, with a real receiver and real attacks.</description><pubDate>Mon, 19 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A webhook is a URL that does something when you hit it. It rebuilds your site, clears a cache, posts in Slack, or emails a customer. Your CMS calls it when content changes. So does anyone else who finds it.&lt;/p&gt;&lt;p&gt;That&amp;#39;s why the receiver has to answer two questions before it does anything: did this really come from my CMS, and is it exactly what my CMS sent? Shapio answers both with a signature on every request. Strapi doesn&amp;#39;t.&lt;/p&gt;&lt;h2 id=&quot;what-strapi-sends&quot;&gt;What Strapi sends&lt;/h2&gt;&lt;p&gt;Strapi&amp;#39;s webhooks carry the event name in &lt;code&gt;X-Strapi-Event&lt;/code&gt; and any fixed headers you configure in &lt;code&gt;defaultHeaders&lt;/code&gt;, usually an &lt;code&gt;Authorization&lt;/code&gt; token you make up and paste into both sides. That&amp;#39;s what you get. Strapi&amp;#39;s own docs recommend signing payloads with an HMAC, but they only show the checking side, as middleware you write yourself. Nothing in Strapi computes the signature. People &lt;a href=&quot;https://feedback.strapi.io/feature-requests/p/webhook-hmac-signature&quot;&gt;asked for signing&lt;/a&gt; in 2023.&lt;/p&gt;&lt;p&gt;This isn&amp;#39;t a hard problem the industry hasn&amp;#39;t solved. &lt;a href=&quot;https://www.contentful.com/developers/docs/webhooks/request-verification/&quot;&gt;Contentful&lt;/a&gt; and &lt;a href=&quot;https://www.npmjs.com/package/@sanity/webhook&quot;&gt;Sanity&lt;/a&gt; both sign their webhooks. They&amp;#39;re hosted, though. Strapi, the most-starred open-source headless CMS on GitHub, leaves signing to you.&lt;/p&gt;&lt;h2 id=&quot;why-a-shared-token-isn-t-enough&quot;&gt;Why a shared token isn&amp;#39;t enough&lt;/h2&gt;&lt;p&gt;A fixed token is better than nothing. It still falls short in three ways:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;It&amp;#39;s the same on every request.&lt;/strong&gt; Anyone who sees one request, in a log, a proxy, or a receiver that prints its headers, can send their own requests forever.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;It doesn&amp;#39;t cover the body.&lt;/strong&gt; Change the payload in transit and the token still matches.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;It never expires.&lt;/strong&gt; Capture a request today and send it again next month.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A signature fixes all three. It&amp;#39;s computed from a secret that never travels with the request, it covers every byte of the body, and it includes the time it was made.&lt;/p&gt;&lt;h2 id=&quot;what-shapio-sends&quot;&gt;What Shapio sends&lt;/h2&gt;&lt;p&gt;Here&amp;#39;s a real request from a Shapio webhook named &amp;quot;Docs site rebuild&amp;quot;, sent when I published a guide:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;x-shapio-event: entry.published
x-shapio-delivery: a34216ab-5c9f-4d82-a877-db0375654177
x-shapio-timestamp: 1792417019
x-shapio-signature: v1=43ca95fb50cd4a5c8ccbcd57cbf3b070cfbc5df72111d7e41615250bb9a19042
content-type: application/json&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{&amp;quot;id&amp;quot;:&amp;quot;da436cfa-1d70-4b38-a4a4-bb3d97096d59&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;entry.published&amp;quot;,&amp;quot;createdAt&amp;quot;:&amp;quot;2026-10-19T13:36:59.277Z&amp;quot;,&amp;quot;site&amp;quot;:{&amp;quot;id&amp;quot;:&amp;quot;00000000-0000-4000-b000-000000000001&amp;quot;,&amp;quot;key&amp;quot;:&amp;quot;default&amp;quot;},&amp;quot;data&amp;quot;:{&amp;quot;modelId&amp;quot;:&amp;quot;138cdac8-b48b-4da6-b72b-3bf79cd9d452&amp;quot;,&amp;quot;modelKey&amp;quot;:&amp;quot;guide&amp;quot;,&amp;quot;routeKey&amp;quot;:&amp;quot;guides&amp;quot;,&amp;quot;ancestors&amp;quot;:[],&amp;quot;entryId&amp;quot;:&amp;quot;c87039d7-4faa-4350-a267-f17f6a3f68b2&amp;quot;,&amp;quot;locale&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;revisionId&amp;quot;:&amp;quot;06274d45-89f0-405f-b201-f2cf60fef6b1&amp;quot;,&amp;quot;snapshot&amp;quot;:6}}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The signature is an HMAC-SHA256 of the timestamp, a dot, and the raw body, keyed with the webhook&amp;#39;s signing secret:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;v1=&amp;lt;hex HMAC-SHA256(secret, &amp;quot;&amp;lt;timestamp&amp;gt;.&amp;lt;raw body&amp;gt;&amp;quot;)&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each webhook gets its own secret. Shapio shows it once when you create the webhook, stores it encrypted, and never sends it anywhere. If it leaks, &lt;strong&gt;Rotate secret&lt;/strong&gt; issues a new one in one click. The old one stops working right away, so give the new one to your receiver at the same time.&lt;/p&gt;&lt;h2 id=&quot;the-receiver&quot;&gt;The receiver&lt;/h2&gt;&lt;p&gt;This is the receiver I ran for this post, exactly as it ran, with &lt;code&gt;@shapio/client&lt;/code&gt; from npm. It checks the signature with &lt;code&gt;verifyWebhookSignature&lt;/code&gt; from &lt;code&gt;@shapio/client&lt;/code&gt;, drops duplicates by delivery ID, and only then does its work:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;import { createServer } from &amp;#39;node:http&amp;#39;;
import { verifyWebhookSignature } from &amp;#39;@shapio/client&amp;#39;;

const secret = process.env.SHAPIO_WEBHOOK_SECRET;
const seen = new Set(); // use your database or Redis in production

createServer((request, response) =&amp;gt; {
  const chunks = [];
  request.on(&amp;#39;data&amp;#39;, (chunk) =&amp;gt; chunks.push(chunk));
  request.on(&amp;#39;end&amp;#39;, async () =&amp;gt; {
    const rawBody = Buffer.concat(chunks).toString(&amp;#39;utf8&amp;#39;);
    const check = await verifyWebhookSignature({
      secret,
      signature: request.headers[&amp;#39;x-shapio-signature&amp;#39;],
      timestamp: request.headers[&amp;#39;x-shapio-timestamp&amp;#39;],
      body: rawBody,
    });
    if (!check.ok) {
      console.log(`rejected: ${check.reason}`);
      response.writeHead(401).end(check.reason);
      return;
    }
    const delivery = request.headers[&amp;#39;x-shapio-delivery&amp;#39;];
    if (seen.has(delivery)) {
      console.log(`duplicate delivery ${delivery}, ignored`);
      response.writeHead(200).end(&amp;#39;duplicate&amp;#39;);
      return;
    }
    seen.add(delivery);
    const event = JSON.parse(rawBody);
    console.log(`verified ${event.type} (delivery ${delivery})`);
    // Rebuild the site, purge the cache, post to Slack...
    response.writeHead(200).end(&amp;#39;ok&amp;#39;);
  });
}).listen(4476);&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;verifyWebhookSignature&lt;/code&gt; uses Web Crypto, so the same code runs outside Node. I checked it in Node 24, Cloudflare&amp;#39;s Workers runtime, Deno, and Chrome. In a browser it needs an HTTPS or localhost page, like anything that uses Web Crypto. It compares in constant time and rejects timestamps more than five minutes off. If you&amp;#39;d rather not add a dependency, the check is a few lines of &lt;code&gt;node:crypto&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;import { createHmac, timingSafeEqual } from &amp;#39;node:crypto&amp;#39;;

const verify = (secret, rawBody, timestamp, signature) =&amp;gt; {
  const expected = `v1=${createHmac(&amp;#39;sha256&amp;#39;, secret).update(`${timestamp}.${rawBody}`).digest(&amp;#39;hex&amp;#39;)}`;
  const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) &amp;lt; 300;
  return (
    fresh &amp;amp;&amp;amp;
    typeof signature === &amp;#39;string&amp;#39; &amp;amp;&amp;amp;
    signature.length === expected.length &amp;amp;&amp;amp;
    timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
  );
};&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Verify the body exactly as it arrived. The signature covers bytes, not a JavaScript object, so check it before you parse anything, and don&amp;#39;t check a version your framework rebuilt for you.&lt;/p&gt;&lt;h2 id=&quot;then-i-attacked-it&quot;&gt;Then I attacked it&lt;/h2&gt;&lt;p&gt;With the receiver running, I sent it four requests that weren&amp;#39;t Shapio&amp;#39;s real ones. These are the actual responses.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;A forged event.&lt;/strong&gt; Someone finds the URL and sends their own &lt;code&gt;entry.published&lt;/code&gt; with a made-up signature:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;forged: 401 signature mismatch&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;A tampered event.&lt;/strong&gt; The real request, real headers, real signature, with one value changed in the body (&lt;code&gt;&amp;quot;modelKey&amp;quot;:&amp;quot;guide&amp;quot;&lt;/code&gt; to &lt;code&gt;&amp;quot;modelKey&amp;quot;:&amp;quot;pricing&amp;quot;&lt;/code&gt;):&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;tampered: 401 signature mismatch&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With a shared token, both of these would have gone through.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;A replay, right away.&lt;/strong&gt; The real request sent again, byte for byte, 11 seconds later:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;replayed right away (11s after it was signed): 200 duplicate&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The signature is valid, because it is a real request. That&amp;#39;s what the delivery ID is for. It&amp;#39;s the same on every retry Shapio makes, so a receiver that remembers it does the work once.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;A replay, later.&lt;/strong&gt; Memory doesn&amp;#39;t last. Receivers restart, deploy, and scale out. So I restarted the receiver, emptying its memory, and sent the same request again five minutes after it was signed:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;replayed after a restart (311s after it was signed): 401 timestamp outside the allowed window&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The signature still matches, but the timestamp is part of what&amp;#39;s signed, so it can&amp;#39;t be updated without the secret. Five minutes is the window, and after that the request is dead.&lt;/p&gt;&lt;h2 id=&quot;everything-shapio-sends-is-signed&quot;&gt;Everything Shapio sends is signed&lt;/h2&gt;&lt;p&gt;It isn&amp;#39;t just webhooks:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Webhooks&lt;/strong&gt;, for every event: entries, media, schema, locales, change sets, deployments, and site settings.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Build triggers.&lt;/strong&gt; A generic build webhook gets the same headers, so your build server can check that a deploy really came from Shapio before it spends ten minutes building.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Build-status callbacks.&lt;/strong&gt; When your build server reports back (&amp;quot;building&amp;quot;, &amp;quot;deployed&amp;quot;, or &amp;quot;failed&amp;quot;), Shapio checks its signature too. Here&amp;#39;s what it said when I tried:&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;unsigned: 401 Callback rejected: missing signature or timestamp
wrong secret: 401 Callback rejected: signature mismatch
stale (10 min old): 401 Callback rejected: timestamp outside the allowed window
signed: 200 {&amp;quot;applied&amp;quot;:true,&amp;quot;status&amp;quot;:&amp;quot;deployed&amp;quot;}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Every attempt is in the webhook&amp;#39;s delivery log in the admin: the request headers (with the signature redacted), your receiver&amp;#39;s response, and how long it took. You can redeliver any of them, or press &lt;strong&gt;Send test&lt;/strong&gt; to check a new receiver before real content flows through it.&lt;/p&gt;&lt;p&gt;Signing should be the default, not a weekend project. It&amp;#39;s on for every webhook in Shapio, and there&amp;#39;s nothing to switch on.&lt;/p&gt;</content:encoded><category>Guide</category></item><item><title>Your content has subtypes. Your CMS should too.</title><link>https://shapio.dev/blog/your-content-has-subtypes/</link><guid isPermaLink="true">https://shapio.dev/blog/your-content-has-subtypes/</guid><description>Shapio 0.5.9 adds polymorphic content types. A content type can extend another, and its kinds inherit the parent&apos;s fields, live in one list with it, and can be pointed at, granted, and changed as a family.</description><pubDate>Wed, 14 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;every-calendar-has-kinds&quot;&gt;Every calendar has kinds&lt;/h2&gt;&lt;p&gt;Take an events calendar. A concert has a lineup. A workshop has a number of seats and a note about what to bring. A talk has a speaker, and a keynote is a talk on the main stage. All of them have a title, a start time, a city, and a price.&lt;/p&gt;&lt;p&gt;Most CMSs give you two ways to model that, and both hurt.&lt;/p&gt;&lt;p&gt;The first is one Event type with every field on it. Concerts carry an empty seats field, workshops carry an empty lineup, and you can&amp;#39;t make the lineup required for concerts only, because the CMS doesn&amp;#39;t know which events are concerts. Your editors see fields that don&amp;#39;t apply, and your API returns them.&lt;/p&gt;&lt;p&gt;The second is four separate types. Now &amp;quot;what&amp;#39;s on in Orlando next week&amp;quot; is four requests merged in your code. Page 2 of that merged list is worse: to know which five events come sixth to tenth, you have to fetch ten from every type, merge, and throw most of them away, and the page count is a guess. A ticket that points at &amp;quot;the event&amp;quot; has to pick one type, or point at several types that have nothing in common as far as the CMS knows. And when you add wheelchair access to events, you add it four times and hope the four stay the same.&lt;/p&gt;&lt;p&gt;The data is a family: events, with kinds. The model should say so. That&amp;#39;s what polymorphic content types are: one type with several kinds, which the API treats as one thing wherever it can and as separate things wherever it has to.&lt;/p&gt;&lt;h2 id=&quot;polymorphic-content-types-in-shapio&quot;&gt;Polymorphic content types in Shapio&lt;/h2&gt;&lt;p&gt;Since 0.5.9, a collection can extend another one. Event holds the shared fields. Concert, Workshop, and Talk extend Event, and Keynote extends Talk. Pick the parent under Extends when you create a type, or set &lt;code&gt;extends&lt;/code&gt; in its schema file.&lt;/p&gt;&lt;p&gt;A kind inherits every field of its parent. In the builder the inherited fields sit in a locked block above the kind&amp;#39;s own fields, with a link to the parent, because the parent owns them. Kinds can have kinds, up to eight levels. In the sidebar they nest under the type they extend.&lt;/p&gt;&lt;h2 id=&quot;one-list-every-kind&quot;&gt;One list, every kind&lt;/h2&gt;&lt;p&gt;A kind is read under its parent:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;GET /api/content/events                       every event, of every kind
GET /api/content/events/talks                 talks, and the keynotes under them
GET /api/content/events/talks/keynotes        keynotes&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here is the Orlando calendar, sorted by start time, three to a page. This is a real response from a Shapio instance, trimmed to the interesting parts:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;GET /api/content/events?filters[city][$eq]=Orlando&amp;amp;sort=startsAt:asc&amp;amp;pageSize=3&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;data&amp;quot;: [
    { &amp;quot;__model&amp;quot;: &amp;quot;event&amp;quot;, &amp;quot;__kinds&amp;quot;: [&amp;quot;event&amp;quot;],
      &amp;quot;title&amp;quot;: &amp;quot;Members social&amp;quot;, &amp;quot;startsAt&amp;quot;: &amp;quot;2026-11-01T22:00:00.000Z&amp;quot;, &amp;quot;city&amp;quot;: &amp;quot;Orlando&amp;quot;, &amp;quot;price&amp;quot;: &amp;quot;0.00&amp;quot; },
    { &amp;quot;__model&amp;quot;: &amp;quot;workshop&amp;quot;, &amp;quot;__kinds&amp;quot;: [&amp;quot;event&amp;quot;, &amp;quot;workshop&amp;quot;],
      &amp;quot;title&amp;quot;: &amp;quot;Intro to letterpress&amp;quot;, &amp;quot;startsAt&amp;quot;: &amp;quot;2026-11-03T15:00:00.000Z&amp;quot;, &amp;quot;city&amp;quot;: &amp;quot;Orlando&amp;quot;, &amp;quot;price&amp;quot;: &amp;quot;60.00&amp;quot;,
      &amp;quot;seats&amp;quot;: 12, &amp;quot;bring&amp;quot;: &amp;quot;An apron&amp;quot; },
    { &amp;quot;__model&amp;quot;: &amp;quot;keynote&amp;quot;, &amp;quot;__kinds&amp;quot;: [&amp;quot;event&amp;quot;, &amp;quot;talk&amp;quot;, &amp;quot;keynote&amp;quot;],
      &amp;quot;title&amp;quot;: &amp;quot;The next ten years of the web&amp;quot;, &amp;quot;startsAt&amp;quot;: &amp;quot;2026-11-05T14:00:00.000Z&amp;quot;, &amp;quot;city&amp;quot;: &amp;quot;Orlando&amp;quot;, &amp;quot;price&amp;quot;: &amp;quot;0.00&amp;quot;,
      &amp;quot;speaker&amp;quot;: &amp;quot;Sam Okafor&amp;quot;, &amp;quot;stage&amp;quot;: &amp;quot;Main hall&amp;quot; }
  ],
  &amp;quot;meta&amp;quot;: {
    &amp;quot;pagination&amp;quot;: { &amp;quot;page&amp;quot;: 1, &amp;quot;pageSize&amp;quot;: 3, &amp;quot;total&amp;quot;: 5, &amp;quot;pageCount&amp;quot;: 2 },
    &amp;quot;kinds&amp;quot;: [
      { &amp;quot;apiKey&amp;quot;: &amp;quot;event&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Event&amp;quot;, &amp;quot;parent&amp;quot;: null, &amp;quot;routeKey&amp;quot;: &amp;quot;events&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;concert&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Concert&amp;quot;, &amp;quot;parent&amp;quot;: &amp;quot;event&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;events/concerts&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;workshop&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Workshop&amp;quot;, &amp;quot;parent&amp;quot;: &amp;quot;event&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;events/workshops&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;talk&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Talk&amp;quot;, &amp;quot;parent&amp;quot;: &amp;quot;event&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;events/talks&amp;quot; },
      { &amp;quot;apiKey&amp;quot;: &amp;quot;keynote&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;Keynote&amp;quot;, &amp;quot;parent&amp;quot;: &amp;quot;talk&amp;quot;, &amp;quot;routeKey&amp;quot;: &amp;quot;events/talks/keynotes&amp;quot; }
    ]
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Page 2 holds the talk and the Night Owls concert. One request per page, one sort across every kind, a real total, and the database does the work: each kind keeps its own indexes, and Shapio reads them together.&lt;/p&gt;&lt;p&gt;A few things in there are doing quiet work:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Each row comes in its own shape. The workshop has seats, the keynote has a speaker and a stage, and the plain event has neither.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;__model&lt;/code&gt; says which kind a row is. &lt;code&gt;__kinds&lt;/code&gt; says everything it is, root first, so a keynote passes a check for talks with &lt;code&gt;__kinds.includes(&amp;#39;talk&amp;#39;)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;meta.kinds&lt;/code&gt; is the family tree, once per response, so a site can build a filter or group a list without asking for the schema.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Filters and sorts take the fields every kind in the list has. Ask a mixed list for &lt;code&gt;fields=lineup&lt;/code&gt; and you get a 400, because most events don&amp;#39;t have one. To filter on a lineup, read &lt;code&gt;/events/concerts&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;filters[__model][$eq]=event&lt;/code&gt; narrows the list to plain events, with the right total.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;a-ticket-can-point-at-any-event&quot;&gt;A ticket can point at any event&lt;/h2&gt;&lt;p&gt;A relation to Event accepts any kind of event. This ticket points at the keynote, and &lt;code&gt;populate&lt;/code&gt; returns it in its own shape:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{ &amp;quot;__model&amp;quot;: &amp;quot;ticket&amp;quot;, &amp;quot;holder&amp;quot;: &amp;quot;Jordan Lee&amp;quot;,
  &amp;quot;event&amp;quot;: { &amp;quot;__model&amp;quot;: &amp;quot;keynote&amp;quot;, &amp;quot;__kinds&amp;quot;: [&amp;quot;event&amp;quot;, &amp;quot;talk&amp;quot;, &amp;quot;keynote&amp;quot;],
             &amp;quot;title&amp;quot;: &amp;quot;The next ten years of the web&amp;quot;, &amp;quot;speaker&amp;quot;: &amp;quot;Sam Okafor&amp;quot;, &amp;quot;stage&amp;quot;: &amp;quot;Main hall&amp;quot; } }&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It still can&amp;#39;t point at a blog post or an author, because those aren&amp;#39;t events. That&amp;#39;s the difference between a family and a relation that accepts a list of unrelated types: Shapio knows every target has a title, a start time, and a price.&lt;/p&gt;&lt;h2 id=&quot;add-a-field-once&quot;&gt;Add a field once&lt;/h2&gt;&lt;p&gt;Say the calendar should show whether each venue is wheelchair accessible. I added one required field to Event, Wheelchair accessible, a boolean that defaults to true. The review said it applied to Event and all four of its kinds, backfilled the default into every existing event of every kind, and built the filter index for each kind. Then it went live. No migration file, no restart, no redeploy.&lt;/p&gt;&lt;p&gt;Every event had it a second later, whatever its kind:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;GET /api/content/events?fields=title,wheelchairAccessible&amp;amp;sort=startsAt:asc&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;[ { &amp;quot;__model&amp;quot;: &amp;quot;event&amp;quot;,    &amp;quot;title&amp;quot;: &amp;quot;Members social&amp;quot;,                &amp;quot;wheelchairAccessible&amp;quot;: true },
  { &amp;quot;__model&amp;quot;: &amp;quot;workshop&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Intro to letterpress&amp;quot;,          &amp;quot;wheelchairAccessible&amp;quot;: true },
  { &amp;quot;__model&amp;quot;: &amp;quot;keynote&amp;quot;,  &amp;quot;title&amp;quot;: &amp;quot;The next ten years of the web&amp;quot;, &amp;quot;wheelchairAccessible&amp;quot;: true },
  { &amp;quot;__model&amp;quot;: &amp;quot;talk&amp;quot;,     &amp;quot;title&amp;quot;: &amp;quot;Content models are data&amp;quot;,       &amp;quot;wheelchairAccessible&amp;quot;: true },
  { &amp;quot;__model&amp;quot;: &amp;quot;concert&amp;quot;,  &amp;quot;title&amp;quot;: &amp;quot;Night Owls&amp;quot;,                    &amp;quot;wheelchairAccessible&amp;quot;: true },
  { &amp;quot;__model&amp;quot;: &amp;quot;concert&amp;quot;,  &amp;quot;title&amp;quot;: &amp;quot;Quiet Rooms&amp;quot;,                   &amp;quot;wheelchairAccessible&amp;quot;: true } ]&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The field exists once, on Event. There is nothing to keep in step.&lt;/p&gt;&lt;h2 id=&quot;a-talk-becomes-a-keynote&quot;&gt;A talk becomes a keynote&lt;/h2&gt;&lt;p&gt;Plans change. Ana&amp;#39;s talk moved to the main stage, so it needed to become a keynote. In the entry&amp;#39;s settings there&amp;#39;s Change kind. Keynote extends Talk, so nothing is lost, and the entry moved:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{ &amp;quot;__model&amp;quot;: &amp;quot;keynote&amp;quot;, &amp;quot;__kinds&amp;quot;: [&amp;quot;event&amp;quot;, &amp;quot;talk&amp;quot;, &amp;quot;keynote&amp;quot;],
  &amp;quot;title&amp;quot;: &amp;quot;Content models are data&amp;quot;, &amp;quot;stage&amp;quot;: null }&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Going the other way drops something. Turning a workshop into a concert would remove its seats and its note about what to bring, and Shapio names both fields and asks you to confirm before it does it. History keeps the old values, and a site pinned to an older snapshot keeps seeing the workshop it built against.&lt;/p&gt;&lt;h2 id=&quot;graphql-gets-an-interface&quot;&gt;GraphQL gets an interface&lt;/h2&gt;&lt;p&gt;A type with kinds gets an interface, and every kind implements it. Ask for the shared fields once and for each kind&amp;#39;s own with a fragment. &lt;code&gt;... on TalkInterface&lt;/code&gt; matches keynotes too, because a keynote is a talk:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-graphql&quot;&gt;{
  events(sort: [{ startsAt: ASC }], pageSize: 4) {
    nodes {
      __typename
      title
      startsAt
      ... on Workshop { seats }
      ... on Concert { lineup }
      ... on TalkInterface { speaker }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A type without kinds keeps exactly the schema it had.&lt;/p&gt;&lt;h2 id=&quot;one-grant-covers-the-family&quot;&gt;One grant covers the family&lt;/h2&gt;&lt;p&gt;A role that may read Event may read every kind of event, including kinds you add next year. A kind can get grants of its own, which only ever add access. So a &amp;quot;Venue partner&amp;quot; role can read every event and also edit workshops, and nobody has to remember to tick a box when Talk gets a new kind.&lt;/p&gt;&lt;h2 id=&quot;how-other-cmss-handle-it&quot;&gt;How other CMSs handle it&lt;/h2&gt;&lt;p&gt;I checked the current docs for Strapi 5, Payload 3, Sanity, Contentful, Directus 11, Hygraph, and WordPress with ACF. None of them has polymorphic content types: no content type can extend another. Several have some of the pieces:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Sanity can list several types in one GROQ query, sorted and sliced together, and a reference can point at several types. WordPress does the same with a list of post types in &lt;code&gt;WP_Query&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Payload, Contentful, Directus, and Hygraph let a relation point at more than one type.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Contentful&amp;#39;s delivery API can list entries of every type at once, but filtering or sorting on a field needs a single content type. In a contentful.js issue, a developer couldn&amp;#39;t filter two types on a field they share, and a maintainer confirmed the API works that way.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Strapi generates its endpoints per content type, and a request on its own feedback board, posted in 2022, asks for relations that can point at more than one type.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Shared field sets exist everywhere: Strapi&amp;#39;s components, ACF field groups, and the field arrays you can reuse in Payload or Sanity code. They save you typing. They don&amp;#39;t make the types a family the API can list, sort, filter, and point at as one thing.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;What I didn&amp;#39;t find anywhere was the whole polymorphic picture together: kinds that inherit from a parent, read as one paged list with each row in its own shape, a relation and a grant that cover the family, and a field added once that reaches every kind while the site is running.&lt;/p&gt;&lt;h2 id=&quot;where-it-stops&quot;&gt;Where it stops&lt;/h2&gt;&lt;p&gt;A kind shares its parent&amp;#39;s Localized and Draft &amp;amp; publish settings and lives where its parent does, shared or on one site. Changing those settings on a parent with kinds goes through a change set, so the whole family moves at once. Filters on a kind&amp;#39;s own field need that kind&amp;#39;s route. And a type extends one parent, not several.&lt;/p&gt;&lt;p&gt;Shapio&amp;#39;s own blog is next. It&amp;#39;s one Post type with fields only guides use. It&amp;#39;s about to become Post, with Guide and Opinion as kinds, without a migration.&lt;/p&gt;</content:encoded><category>Announcement</category></item><item><title>A product is not a blog post</title><link>https://shapio.dev/blog/a-product-is-not-a-blog-post/</link><guid isPermaLink="true">https://shapio.dev/blog/a-product-is-not-a-blog-post/</guid><description>Shapio 0.5.5 lets each content type open as a document or as a form, and keeps that choice in the schema with everything else.</description><pubDate>Sun, 11 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;a-game-level-made-it-obvious&quot;&gt;A game level made it obvious&lt;/h2&gt;&lt;p&gt;Open a game level in Shapio and you got a huge title, two code fields floating in a column, and the rest of its fields tucked into a drawer on the right. Nothing was broken. The page just gave its space to the wrong things.&lt;/p&gt;&lt;p&gt;A product had the same problem. Its description belonged in the writing area, but the price, the SKU, and the stock count were properties: chips under the title, rows in the drawer. To fill in one record you moved between three places.&lt;/p&gt;&lt;p&gt;I built Shapio&amp;#39;s document layout for articles and pages. You type a big title straight into the page, then write in a canvas of blocks: rich text, dynamic zones, repeatable components, galleries. Every other field is a property, in a strip under the title and in the settings drawer. For an article that is the right shape. For a redirect rule, a job listing, a level, or a config record, it isn&amp;#39;t. Those are forms.&lt;/p&gt;&lt;p&gt;The field types don&amp;#39;t settle it, either. A product has a rich-text description and is still a form. The person building the content model knows what the thing is, so they should say.&lt;/p&gt;&lt;h2 id=&quot;document-or-form&quot;&gt;Document or form&lt;/h2&gt;&lt;p&gt;Since 0.5.5 each content type has a layout setting, under Display in the model builder: Document or Form.&lt;/p&gt;&lt;p&gt;Document is the default and hasn&amp;#39;t changed. Form is a choice you make. Nothing switches on its own: adding a rich-text field doesn&amp;#39;t turn a type into a document, and removing one doesn&amp;#39;t turn it into a form.&lt;/p&gt;&lt;p&gt;In a form, every field is on the page, top to bottom, the title included. Its value is the page heading, shown as text, and the field itself sits with the others. The settings drawer keeps status, locales, history, and the danger zone, nothing content-related. A pre-flight &amp;quot;Fix&amp;quot; link scrolls to the field on the page.&lt;/p&gt;&lt;p&gt;If you manage the schema you can also flip the layout from any entry&amp;#39;s Settings drawer. It ships at once as a metadata change, with Undo in the toast. It is still a decision about the type, not the entry; you just get to make it while looking at one.&lt;/p&gt;&lt;h2 id=&quot;widths-order-groups&quot;&gt;Widths, order, groups&lt;/h2&gt;&lt;p&gt;Each field has a width: Full, Two thirds, Half, or Third. Rows fill in field order and wrap. Two halves sit side by side, three thirds share a row, and below about 500 pixels of column everything stacks. You reorder fields the way you already did in the builder: drag, arrow keys, or the chevrons. A wireframe next to the setting redraws as you change widths and order.&lt;/p&gt;&lt;p&gt;There is no drag-and-drop grid, on purpose. Order plus width gets you side by side without a second drag surface, collision rules, or a &amp;quot;what happens on a phone&amp;quot; question. Strapi arranges its edit view on a twelve-column grid with widths of 4, 6, 8, or 12; the words map to the same proportions. The difference is how you get there.&lt;/p&gt;&lt;p&gt;A field can go in a named group from its settings, say Pricing. The group renders as a section of the form with a heading, sitting where its first field is. Ungrouped fields keep their place. Groups are renamed or removed under Display.&lt;/p&gt;&lt;h2 id=&quot;the-layout-is-schema&quot;&gt;The layout is schema&lt;/h2&gt;&lt;p&gt;This is the part I care about. The layout is &lt;code&gt;display.layout&lt;/code&gt; on the model, the width is &lt;code&gt;width&lt;/code&gt; on the field, and the groups are &lt;code&gt;display.groups&lt;/code&gt;. All of it is schema data: live on save, no restart, and carried by &lt;code&gt;shapio schema pull&lt;/code&gt; and &lt;code&gt;schema apply&lt;/code&gt; into your repo and on to the next environment. In a change set it shows up as a metadata change, next to the fields it arranges.&lt;/p&gt;&lt;p&gt;That matters for teams. The way a form is laid out is useful information about how people are meant to work with a model, and it should travel with the model instead of being rebuilt by hand on every instance. Strapi&amp;#39;s &amp;quot;Configure the view&amp;quot; keeps its layout in the database rather than in the schema files, so moving it between environments takes a plugin.&lt;/p&gt;&lt;h2 id=&quot;two-smaller-things&quot;&gt;Two smaller things&lt;/h2&gt;&lt;p&gt;The Entries, Structure, and API tabs now sit above every entry, not only above a single type&amp;#39;s document. When you notice a record&amp;#39;s layout needs work, the builder is one click away.&lt;/p&gt;&lt;p&gt;Team and Network have their own links in the sidebar. Before, the only way to the admins, the roles, and the shared content types was the site switcher, and I kept forgetting that myself.&lt;/p&gt;</content:encoded><category>Announcement</category></item><item><title>Content that is code: using Shapio&apos;s code field</title><link>https://shapio.dev/blog/content-that-is-code/</link><guid isPermaLink="true">https://shapio.dev/blog/content-that-is-code/</guid><description>You will have a code field for a game&apos;s dialogue script, an app&apos;s config and a site&apos;s head tag, and know how each one reaches its client.</description><pubDate>Thu, 08 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Would you open this value in a code editor? Then it is a code field.&lt;/p&gt;&lt;p&gt;A dialogue script, a runtime configuration file or an HTML embed is content that is code. It has syntax. Its whitespace may matter. Another program consumes it. A product&amp;#39;s price or a post&amp;#39;s title belongs in a normal field.&lt;/p&gt;&lt;p&gt;Shapio&amp;#39;s new &lt;code&gt;code&lt;/code&gt; field stores a string. It never trims, reformats or rewrites that string. Bytes in equal bytes out. The language setting tells the editor and API what kind of text the field contains.&lt;/p&gt;&lt;p&gt;Here are three ways to use it, starting with the program that consumes the content.&lt;/p&gt;&lt;h2 id=&quot;a-game-dialogue-written-by-the-writer&quot;&gt;A game: dialogue written by the writer&lt;/h2&gt;&lt;p&gt;A writer can keep a dialogue script in the CMS. The game downloads the string and passes it to its dialogue runtime for parsing.&lt;/p&gt;&lt;p&gt;For example, an ink script might contain:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;=== gatekeeper ===
The gatekeeper lowers her lantern.
* [Ask about the road]
    &amp;quot;Stay east of the river.&amp;quot;
    -&amp;gt; END
* [Leave]
    -&amp;gt; END&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create a code field and set its language to &lt;code&gt;plain&lt;/code&gt;. Ink, Yarn and Lua are not language options yet. Plain gives the writer a monospaced editor and line numbers, without syntax highlighting.&lt;/p&gt;&lt;p&gt;That choice does not change the stored script. Shapio preserves the line breaks, indentation and punctuation exactly as entered. The game receives the string through REST and gives it to the runtime that understands ink.&lt;/p&gt;&lt;p&gt;The API also describes the field&amp;#39;s language. With &lt;code&gt;plain&lt;/code&gt;, that metadata identifies plain code text, not ink specifically. The game still needs to know which dialogue parser to use. The language setting describes the field; it does not select a runtime.&lt;/p&gt;&lt;p&gt;The admin uses CodeMirror. Tab moves focus to the next control, just as it does elsewhere in the admin. To indent, use Cmd-] and Cmd-[, or Ctrl-] and Ctrl-[ on Windows and Linux.&lt;/p&gt;&lt;h2 id=&quot;an-app-or-engine-configuration-its-runtime-already-reads&quot;&gt;An app or engine: configuration its runtime already reads&lt;/h2&gt;&lt;p&gt;A code field also fits configuration that an app or engine already reads as JSON or YAML. Think drop rates, feature flags or wave timings.&lt;/p&gt;&lt;p&gt;For a JSON configuration field, set the language to &lt;code&gt;json&lt;/code&gt; and turn on Require valid JSON. An editor could maintain:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;dropRate&amp;quot;: 0.15,
  &amp;quot;features&amp;quot;: {
    &amp;quot;bonusRound&amp;quot;: true
  },
  &amp;quot;waveTimings&amp;quot;: [0, 15, 30]
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The runtime downloads the string and parses it as it would its existing JSON configuration. Shapio does not turn those keys into separate fields. The value remains one string.&lt;/p&gt;&lt;p&gt;Now suppose someone removes the comma after the drop rate:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;{
  &amp;quot;dropRate&amp;quot;: 0.15
  &amp;quot;features&amp;quot;: {
    &amp;quot;bonusRound&amp;quot;: true
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With the parse check enabled, the field shows &amp;quot;Must be valid JSON&amp;quot; before saving. The server refuses the invalid value too. That bad edit cannot become the saved configuration that the app downloads.&lt;/p&gt;&lt;img src=&quot;https://itsasite.com/api/media/f/public/88e4aa6d-fc90-4dbf-8170-55c619f4a38a/e457177c2b3302ea9ebb89a2/code-field-json-invalid-v2.png&quot; alt=&quot;A JSON config field showing Must be valid JSON&quot;&gt;&lt;p&gt;The check establishes that the value parses as JSON. It does not establish that a drop rate is sensible or that the runtime recognizes a feature name. Those are separate concerns for the consuming app.&lt;/p&gt;&lt;p&gt;Use &lt;code&gt;yaml&lt;/code&gt; when the runtime already reads YAML. Syntax highlighting follows the field&amp;#39;s language, and its language pack loads only when a field uses it. The Require valid JSON option is for JSON fields.&lt;/p&gt;&lt;h2 id=&quot;a-website-an-editor-controlled-verification-tag&quot;&gt;A website: an editor-controlled verification tag&lt;/h2&gt;&lt;p&gt;For a website, the code might be a verification tag in the head or an analytics loader at the end of the body.&lt;/p&gt;&lt;p&gt;Create an HTML code field named &lt;code&gt;embed&lt;/code&gt;. An editor can enter a verification tag:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;meta name=&amp;quot;example-site-verification&amp;quot; content=&amp;quot;verification-token&amp;quot;&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;img src=&quot;https://itsasite.com/api/media/f/public/43dd806c-9b4d-47a9-a195-58b859a62ae7/c9f0df700b06610727883c05/code-field-html-editor.png&quot; alt=&quot;An HTML code field in the Shapio admin&quot;&gt;&lt;p&gt;In an Astro page, render the string into the head. Here, &lt;code&gt;site&lt;/code&gt; is the content object your page has fetched:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-astro&quot;&gt;---
const { site } = Astro.props;
---

&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset=&amp;quot;utf-8&amp;quot; /&amp;gt;
    &amp;lt;Fragment set:html={site.embed ?? &amp;quot;&amp;quot;} /&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;slot /&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The same approach can place an editor-maintained script near the closing body tag.&lt;/p&gt;&lt;p&gt;On a static site, the change goes live after the next build, not instantly. Adding the field itself needs no rebuild, restart or deploy of Shapio. Models change live in the admin while Shapio runs. The website&amp;#39;s build is a separate step.&lt;/p&gt;&lt;h2 id=&quot;what-the-api-sees&quot;&gt;What the API sees&lt;/h2&gt;&lt;p&gt;In a schema file, an HTML code field uses:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &amp;quot;type&amp;quot;: &amp;quot;code&amp;quot;,
  &amp;quot;settings&amp;quot;: {
    &amp;quot;language&amp;quot;: &amp;quot;html&amp;quot;
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Language is set once per field, not per entry. The options are &lt;code&gt;plain&lt;/code&gt;, &lt;code&gt;html&lt;/code&gt;, &lt;code&gt;css&lt;/code&gt;, &lt;code&gt;javascript&lt;/code&gt;, &lt;code&gt;json&lt;/code&gt;, &lt;code&gt;yaml&lt;/code&gt; and &lt;code&gt;markdown&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;REST returns the string. GraphQL returns &lt;code&gt;String&lt;/code&gt;, with a field description ending in &lt;code&gt;Code: html&lt;/code&gt;. OpenAPI adds &lt;code&gt;x-shapio-language&lt;/code&gt; and, for HTML, &lt;code&gt;contentMediaType: text/html&lt;/code&gt;. Generated TypeScript keeps the language in its doc comment:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;/** Embed (Code: html) */
embed: string | null;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Code fields cannot be unique, filterable or sortable. Changing long text to code preserves every value, but the planner flags the change as breaking because filtering is lost. Confirm it in the change set or use &lt;code&gt;--allow-breaking&lt;/code&gt; with &lt;code&gt;shapio schema apply&lt;/code&gt;. Changing code back to text is not breaking.&lt;/p&gt;&lt;p&gt;Use a code field when the content belongs in a code editor and a client consumes its syntax. Keep prices and titles in normal fields. Let the writer or editor maintain the source, let Shapio preserve its bytes, and let the game, app or website interpret it.&lt;/p&gt;</content:encoded><category>Guide</category></item><item><title>I didn&apos;t build redirects into my CMS</title><link>https://shapio.dev/blog/redirects-as-a-content-type/</link><guid isPermaLink="true">https://shapio.dev/blog/redirects-as-a-content-type/</guid><description>I took redirects off Shapio&apos;s feature list because a content type and a build step already do the job.</description><pubDate>Wed, 07 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;the-roadmap-card&quot;&gt;The roadmap card&lt;/h2&gt;&lt;p&gt;Redirects were a Now item on the shapio.dev roadmap. The card promised redirects “managed per site in the admin and written into your host&amp;#39;s redirect file at build time”. I decided not to build that feature.&lt;/p&gt;&lt;p&gt;Shapio is an open-source, self-hosted headless CMS. Its content model is data in the database, so you can change a type in the admin while production keeps running. The REST and GraphQL APIs serve a new field on the next request, without a rebuild, restart or deploy.&lt;/p&gt;&lt;p&gt;Redirects are website plumbing. The CMS does not need to know what a redirect is. It needs to store the entries, control who can read them and deliver them to the build.&lt;/p&gt;&lt;p&gt;What Strapi users add with a community plugin, and WordPress users with a plugin that has millions of installs, is a content type and a build step here. The existing model and delivery API can carry the data.&lt;/p&gt;&lt;h2 id=&quot;make-the-type&quot;&gt;Make the type&lt;/h2&gt;&lt;p&gt;In the admin, create a content type named &lt;code&gt;redirect&lt;/code&gt; (its plural API ID is &lt;code&gt;redirects&lt;/code&gt;). Give it these fields:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;from&lt;/code&gt;: short text, required, unique.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;to&lt;/code&gt;: short text, required.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;type&lt;/code&gt;: choice with the values &lt;code&gt;permanent&lt;/code&gt; (label 301) and &lt;code&gt;temporary&lt;/code&gt; (label 302), default &lt;code&gt;permanent&lt;/code&gt;. Choice values must be GraphQL names, so they cannot be numbers. The field cannot be called &lt;code&gt;status&lt;/code&gt;, because every entry already has a system field with that name.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;enabled&lt;/code&gt;: boolean, default true.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;note&lt;/code&gt;: long text.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;That takes two minutes, live, with no deploy. Give the site&amp;#39;s build token, through its delivery role, read access to the type. In the starter, that role is “Starter site (delivery)”.&lt;/p&gt;&lt;p&gt;Only published redirects reach the build, because the delivery API serves published content only. On an instance with several sites, the type belongs to the site that uses it.&lt;/p&gt;&lt;h2 id=&quot;write-the-file-at-build-time&quot;&gt;Write the file at build time&lt;/h2&gt;&lt;p&gt;The Astro starter already writes a &lt;code&gt;_headers&lt;/code&gt; file at build time for Cloudflare Pages and Netlify. Put &lt;code&gt;_redirects&lt;/code&gt; beside it in &lt;code&gt;dist&lt;/code&gt;. Both hosts read that file, with one rule per line in the form &lt;code&gt;from to status&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;In the Astro starter, &lt;code&gt;src/lib/shapio.ts&lt;/code&gt; has a &lt;code&gt;listAll&lt;/code&gt; helper that reads a collection page by page at the build&amp;#39;s pinned snapshot (one delivery page holds at most 100 entries). It always asks for SEO fields with the site&amp;#39;s defaults filled in, which Shapio refuses for a type without an SEO field. Export it, and move its &lt;code&gt;...query&lt;/code&gt; line below &lt;code&gt;seo: &amp;#39;resolved&amp;#39;&lt;/code&gt; so a caller can override that:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-ts&quot;&gt;export const listAll = async &amp;lt;T&amp;gt;(routeKey: string, query: DeliveryListQuery): Promise&amp;lt;T[]&amp;gt; =&amp;gt; {
  // …
    const result = await shapio().delivery.list&amp;lt;T&amp;gt;(routeKey, {
      richText: &amp;#39;html&amp;#39;,
      seo: &amp;#39;resolved&amp;#39;,
      ...query,
      snapshot,
      page,
      pageSize: PAGE_SIZE,
    });&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then add a page that writes the file. Astro turns &lt;code&gt;src/pages/redirects.txt.ts&lt;/code&gt; into &lt;code&gt;dist/redirects.txt&lt;/code&gt;, and a rename at the end of the build script makes it &lt;code&gt;_redirects&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-ts&quot;&gt;// src/pages/redirects.txt.ts
import { listAll } from &amp;#39;../lib/shapio.js&amp;#39;;

type Redirect = { from: string; to: string; type: &amp;#39;permanent&amp;#39; | &amp;#39;temporary&amp;#39;; enabled: boolean };

const CODE = { permanent: 301, temporary: 302 } as const;

export const GET = async () =&amp;gt; {
  const rules = await listAll&amp;lt;Redirect&amp;gt;(&amp;#39;redirects&amp;#39;, { seo: &amp;#39;raw&amp;#39; });
  const lines = rules.filter((r) =&amp;gt; r.enabled).map((r) =&amp;gt; `${r.from} ${r.to} ${CODE[r.type]}`);
  return new Response(lines.join(&amp;#39;\n&amp;#39;) + &amp;#39;\n&amp;#39;);
};&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;&amp;quot;build&amp;quot;: &amp;quot;ASTRO_TELEMETRY_DISABLED=1 astro build &amp;amp;&amp;amp; mv dist/redirects.txt dist/_redirects&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The pinned snapshot matters for the same reason it matters for the pages. Shapio&amp;#39;s change sets and publication snapshots let schema and content ship together, and a build can pin a snapshot so every page sees one consistent moment. The redirect list should come from that moment too.&lt;/p&gt;&lt;p&gt;There is no separate publishing path to add. With a deployment connection, publishing a redirect rebuilds the site the same way publishing a post does.&lt;/p&gt;&lt;h2 id=&quot;next-js-and-sveltekit&quot;&gt;Next.js and SvelteKit&lt;/h2&gt;&lt;p&gt;For Next.js, the same list goes into &lt;code&gt;redirects()&lt;/code&gt; in &lt;code&gt;next.config&lt;/code&gt;, which is already async. Map &lt;code&gt;permanent&lt;/code&gt; to &lt;code&gt;statusCode: 301&lt;/code&gt; and &lt;code&gt;temporary&lt;/code&gt; to &lt;code&gt;statusCode: 302&lt;/code&gt;; Next&amp;#39;s own &lt;code&gt;permanent: true&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt; send 308 and 307. Next reads &lt;code&gt;redirects()&lt;/code&gt; at build time, and the Next starter revalidates on publish instead of rebuilding, so a new redirect goes live with the next deploy. For SvelteKit, write &lt;code&gt;build/_redirects&lt;/code&gt; the same way as Astro.&lt;/p&gt;&lt;h2 id=&quot;the-missing-prompt&quot;&gt;The missing prompt&lt;/h2&gt;&lt;p&gt;There is an honest gap: the one-click “your slug changed, add a redirect” prompt. That needs the CMS to notice that a slug moved on a published entry. Creating a type and writing a file does not supply that prompt.&lt;/p&gt;&lt;p&gt;That is the one piece that may belong in core later, as a generic &amp;quot;field changed&amp;quot; event, not as a redirects feature.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;A redirect is a content type and a build step.&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;the-test-for-core&quot;&gt;The test for core&lt;/h2&gt;&lt;p&gt;I now apply this test to roadmap items: does the work improve the model or the API for any consumer? That consumer might be a site, an app, a game or a script. Or does the work only help a website on one host?&lt;/p&gt;&lt;p&gt;Core takes the first. Starters take the second. Redirect file generation goes in the starter.&lt;/p&gt;</content:encoded><category>Guide</category></item><item><title>See saved drafts on your development server</title><link>https://shapio.dev/blog/see-saved-drafts-on-your-development-server/</link><guid isPermaLink="true">https://shapio.dev/blog/see-saved-drafts-on-your-development-server/</guid><description>You will have a local site that reads saved drafts, shows a Drafts badge, and lets you check changes without publishing.</description><pubDate>Tue, 06 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Drafts mode lets your development server render the content saved in Shapio, including entries never published. You save in the admin and reload the page on your machine. Publish stays a production action: it updates your live site.&lt;/p&gt;&lt;h2 id=&quot;before-you-start&quot;&gt;Before you start&lt;/h2&gt;&lt;p&gt;You need a running Shapio with an owner account. Choose the starter for the framework you use: Next.js, Astro, or SvelteKit. All three render the same blog and support drafts mode.&lt;/p&gt;&lt;p&gt;You also need a delivery token whose role grants &lt;code&gt;read&lt;/code&gt; on the site&amp;#39;s models and Read drafts. The starter seed creates that role and token for you. Keep the dev token in your local environment. Never put it in production.&lt;/p&gt;&lt;h2 id=&quot;step-1-create-your-starter&quot;&gt;Step 1: Create your starter&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx create-shapio my-site --site next      # or astro, sveltekit
cd my-site&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This creates the framework app and the blog&amp;#39;s model files in &lt;code&gt;shapio/&lt;/code&gt;. Keep &lt;code&gt;--site&lt;/code&gt;: without it, &lt;code&gt;create-shapio&lt;/code&gt; creates a Shapio CMS project instead.&lt;/p&gt;&lt;h2 id=&quot;step-2-seed-the-content-and-dev-token&quot;&gt;Step 2: Seed the content and dev token&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;SHAPIO_URL=http://localhost:4300 SHAPIO_ADMIN_EMAIL=you@example.com SHAPIO_ADMIN_PASSWORD=&amp;#39;…&amp;#39; npm run seed&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The seed applies models, creates and publishes content in English and French, and leaves one article as a draft. It writes &lt;code&gt;.env&lt;/code&gt;, including &lt;code&gt;SHAPIO_DEV_DELIVERY_TOKEN&lt;/code&gt; for the second delivery role, &lt;code&gt;&amp;lt;site&amp;gt; dev&lt;/code&gt;, which may read drafts.&lt;/p&gt;&lt;p&gt;The seed is idempotent: running it again resets the content. It signs in with a temporary admin API token and revokes that token when it ends.&lt;/p&gt;&lt;h2 id=&quot;step-3-check-the-delivery-role&quot;&gt;Step 3: Check the delivery role&lt;/h2&gt;&lt;p&gt;The seed already did this. If you create the role yourself, open Network → Roles → New role, choose kind Delivery, grant &lt;code&gt;read&lt;/code&gt; on the site&amp;#39;s models, and enable Read drafts. Then create a token bound to that role in Settings → API tokens; the tokens list marks it with a Drafts chip.&lt;/p&gt;&lt;p&gt;Read drafts covers every model the role reads. It adds no model of its own, so you still need the model grants. Delivery tokens can only read, whatever their role says.&lt;/p&gt;&lt;h2 id=&quot;step-4-turn-on-drafts-locally&quot;&gt;Step 4: Turn on drafts locally&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;SHAPIO_DRAFTS=true&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Set this in your local &lt;code&gt;.env&lt;/code&gt;; the starter reads saved drafts with &lt;code&gt;SHAPIO_DEV_DELIVERY_TOKEN&lt;/code&gt; when it is set, otherwise with &lt;code&gt;SHAPIO_DELIVERY_TOKEN&lt;/code&gt;. Every page carries a Drafts badge in its corner, and drafts mode pins no snapshot.&lt;/p&gt;&lt;p&gt;Every read is fresh. Under Next.js, draft reads are never cached or tagged, and the Next starter&amp;#39;s &lt;code&gt;/api/revalidate&lt;/code&gt; route does nothing. A local build can also read drafts with this setting. Never set &lt;code&gt;SHAPIO_DRAFTS&lt;/code&gt; or put the dev token in a production environment.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Publishing updates your live site, so it is not how you check a change.&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;step-5-start-the-development-server&quot;&gt;Step 5: Start the development server&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npm run dev&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Save a change in the admin, then reload the page on your machine. The saved change should appear, with the Drafts badge still visible.&lt;/p&gt;&lt;p&gt;Drafts include autosaves and may not pass validation yet. A required field can be empty, so render drafts defensively. Drafts mode covers the whole site for developers; the admin&amp;#39;s Preview pane is for previewing one entry, and the starter&amp;#39;s &lt;code&gt;/preview/&lt;/code&gt; page is unchanged.&lt;/p&gt;&lt;h2 id=&quot;step-6-check-a-draft-read-directly&quot;&gt;Step 6: Check a draft read directly&lt;/h2&gt;&lt;p&gt;In a shell with &lt;code&gt;SHAPIO_URL&lt;/code&gt; and &lt;code&gt;SHAPIO_DEV_DELIVERY_TOKEN&lt;/code&gt; set to the values in &lt;code&gt;.env&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -H &amp;quot;Authorization: Bearer $SHAPIO_DEV_DELIVERY_TOKEN&amp;quot; \
  &amp;quot;$SHAPIO_URL/api/content/articles?publicationState=draft&amp;amp;populate=author&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The REST request asks for drafts with &lt;code&gt;publicationState=draft&lt;/code&gt; and returns each entry&amp;#39;s saved draft in the delivery shape, including entries never published. Look for &lt;code&gt;meta.publicationState: &amp;quot;draft&amp;quot;&lt;/code&gt;; relation targets and &lt;code&gt;populate&lt;/code&gt; follow drafts too, within the models your role may read.&lt;/p&gt;&lt;p&gt;For GraphQL, request &lt;code&gt;publicationState: DRAFT&lt;/code&gt;. With &lt;code&gt;@shapio/client&lt;/code&gt;, use &lt;code&gt;drafts: true&lt;/code&gt; on &lt;code&gt;createClient&lt;/code&gt;; with &lt;code&gt;@shapio/local&lt;/code&gt;, use it on &lt;code&gt;createLocalClient&lt;/code&gt;. The server requires Read drafts and the site must ask for drafts. Anonymous callers and end-user accounts can never read them.&lt;/p&gt;&lt;h2 id=&quot;check-it-worked&quot;&gt;Check it worked&lt;/h2&gt;&lt;p&gt;Check a saved edit after reloading and confirm the page shows the Drafts badge. The direct REST response should identify its publication state as draft and carry &lt;code&gt;Cache-Control: private, no-store&lt;/code&gt;, so no cache keeps it.&lt;/p&gt;&lt;p&gt;Leave Publish for production. Published reads are unaffected; drafts mode gives your machine access to saved content without publishing it.&lt;/p&gt;&lt;h2 id=&quot;when-it-goes-wrong&quot;&gt;When it goes wrong&lt;/h2&gt;&lt;p&gt;If the token lacks Read drafts, the server returns &lt;code&gt;403 DRAFTS_FORBIDDEN&lt;/code&gt; with a message naming the grant. The starter&amp;#39;s first read fails: a build stops, or the dev server shows the message on its error page. It never falls back to published content. Check that the selected token belongs to the delivery role with Read drafts and the required model grants.&lt;/p&gt;&lt;p&gt;A draft cannot be pinned. Combining &lt;code&gt;publicationState=draft&lt;/code&gt; with &lt;code&gt;snapshot&lt;/code&gt; returns a 400. Check that your direct draft request does not also request a snapshot.&lt;/p&gt;</content:encoded><category>Guide</category></item><item><title>Drafts had to be a permission, not a flag</title><link>https://shapio.dev/blog/drafts-had-to-be-a-permission/</link><guid isPermaLink="true">https://shapio.dev/blog/drafts-had-to-be-a-permission/</guid><description>Testing saved content on a development server should require permission to read drafts, without turning Publish into a development tool.</description><pubDate>Mon, 05 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;save-refresh-nothing&quot;&gt;Save, refresh, nothing&lt;/h2&gt;&lt;p&gt;I was editing my own site&amp;#39;s content in the Shapio admin with the site&amp;#39;s development server running. I saved a change, refreshed the page, and nothing changed. I asked whether I had to publish too.&lt;/p&gt;&lt;p&gt;The answer was yes. The site reads published content only, by design. Drafts never leak to the public API, so saving a draft had done exactly what it was supposed to do.&lt;/p&gt;&lt;h2 id=&quot;publish-meant-production&quot;&gt;Publish meant production&lt;/h2&gt;&lt;p&gt;My objection was simple: Publish is a production action. On my site, publishing fires a Cloudflare Pages rebuild of the live site. Using that button to test content on a development server would also ship it.&lt;/p&gt;&lt;p&gt;That left a gap between saving content and seeing it in the development site. Shapio already had per-entry preview tokens for the admin&amp;#39;s Preview pane. Those covered one entry for one hour.&lt;/p&gt;&lt;p&gt;A per-entry preview did not give the development server access to saved drafts across the site. I wanted to render those drafts while keeping Publish as the action that changes production. That distinction belongs in the product, even when the person editing the content also runs the site.&lt;/p&gt;&lt;h2 id=&quot;the-tempting-flag&quot;&gt;The tempting flag&lt;/h2&gt;&lt;p&gt;The wrong fix would have been a site setting: &lt;code&gt;SHAPIO_DRAFTS=true&lt;/code&gt;. Set it, ask the server for drafts, and have the server hand them over. It would have answered my immediate complaint.&lt;/p&gt;&lt;p&gt;It would also have made any site with that flag able to read any draft. The rule that public delivery never leaks drafts would then depend on a configuration value on someone else&amp;#39;s machine. That is an unacceptable place to enforce access.&lt;/p&gt;&lt;p&gt;The site can decide which content it wants to request. The server has to decide which content the caller is allowed to receive. Combining those decisions into one flag makes the access rule too easy to mistake for a development convenience.&lt;/p&gt;&lt;h2 id=&quot;two-safeguards&quot;&gt;Two safeguards&lt;/h2&gt;&lt;p&gt;The fix shipped on October 5, 2026, in release 0.5.1. Delivery roles gained a new permission, &amp;quot;Read drafts&amp;quot;. That permission covers every model the role can read.&lt;/p&gt;&lt;p&gt;The delivery API accepts &lt;code&gt;?publicationState=draft&lt;/code&gt;, and GraphQL accepts &lt;code&gt;publicationState: DRAFT&lt;/code&gt;. A token without the grant gets &lt;code&gt;DRAFTS_FORBIDDEN&lt;/code&gt;. Anonymous callers and end-user accounts can never read drafts.&lt;/p&gt;&lt;p&gt;That gives us two required safeguards: the grant on the server and the request from the site. The token must be allowed to read drafts, and the site must ask for them. A production token has no grant, so the flag alone shows nothing.&lt;/p&gt;&lt;p&gt;The starters use &lt;code&gt;SHAPIO_DRAFTS=true&lt;/code&gt; to turn on draft reads with a separate development token created by the seed. They also show a &amp;quot;Drafts&amp;quot; badge on every page. The development token is never put in a production environment.&lt;/p&gt;&lt;p&gt;The flag still exists, but it now expresses what the site is asking to render. It cannot grant itself access. Configuration selects the mode, while the server enforces the permission.&lt;/p&gt;&lt;p&gt;Draft responses also carry &lt;code&gt;Cache-Control: private, no-store&lt;/code&gt;. The client has a &lt;code&gt;drafts: true&lt;/code&gt; option, and under Next.js those reads are never cached or tagged. Being allowed to read a draft never makes it cacheable.&lt;/p&gt;&lt;h2 id=&quot;relations-exposed-the-mistake&quot;&gt;Relations exposed the mistake&lt;/h2&gt;&lt;p&gt;The first draft of the plan had a per-model grant. Review caught the problem with it: related entries were only checked for plain read permission, so a token allowed drafts of posts could have pulled draft authors through a relation.&lt;/p&gt;&lt;p&gt;The grant became token-wide, covering every model the role reads. A caller&amp;#39;s ability to read drafts therefore applies across those models, including the related entries.&lt;/p&gt;&lt;p&gt;Plan review caught several problems like it before any code was written, and the change shipped in one release. The relation catch is the one I keep coming back to. It shows why the permission needs to cover the content a request can reach, rather than just the entry where the request starts.&lt;/p&gt;&lt;h2 id=&quot;who-enforces-it&quot;&gt;Who enforces it&lt;/h2&gt;&lt;blockquote&gt;&lt;p&gt;If the server cannot refuse it, it is not a permission, it is a hope.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;That is my test for where a thing belongs: who enforces it. A site can ask for drafts with a flag. The server must be able to say no.&lt;/p&gt;</content:encoded><category>Opinion</category></item><item><title>Move a Strapi 5 project to Shapio with the importer</title><link>https://shapio.dev/blog/move-a-strapi-5-project-to-shapio/</link><guid isPermaLink="true">https://shapio.dev/blog/move-a-strapi-5-project-to-shapio/</guid><description>You will have your Strapi 5 models, media and content in Shapio, as drafts plus a change set that publishes them when you ship it.</description><pubDate>Sun, 04 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The importer turns Strapi content types into models, documents into entries, and uploads into media library assets. Every entry is created as a draft, and the ones that were published in Strapi are collected into a change set you review and ship.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Nothing goes live by itself.&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;before-you-start&quot;&gt;Before you start&lt;/h2&gt;&lt;p&gt;You need a Strapi 5 project and a running Shapio instance. Only Strapi 5 exports are supported.&lt;/p&gt;&lt;p&gt;Open &lt;code&gt;/admin/&lt;/code&gt; on the instance. If no admin account exists yet, Setup asks for your name, email and a password of at least 12 characters, entered twice. Do it right after the first start: until then, anyone who can reach the server can claim it.&lt;/p&gt;&lt;p&gt;Create the token the import runs with. In the admin, open Settings → API tokens, choose New token, give it a name, pick the Admin role and choose Create. The token is shown only once: copy it.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;export SHAPIO_URL=https://cms.example.com
export SHAPIO_TOKEN=&amp;quot;&amp;lt;the token&amp;gt;&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run every &lt;code&gt;npx shapio&lt;/code&gt; command below in your Shapio project (the one &lt;code&gt;npm install @shapio/cms&lt;/code&gt; or &lt;code&gt;create-shapio&lt;/code&gt; set up), where &lt;code&gt;npx shapio&lt;/code&gt; finds the CLI. Anywhere else, including inside the Strapi project, use &lt;code&gt;npx -p @shapio/cms shapio&lt;/code&gt; instead.&lt;/p&gt;&lt;p&gt;If your Strapi content is localized, add the same locales in Settings → Locales (Add locale, then a code such as &lt;code&gt;fr&lt;/code&gt; and a name). The import refuses to start while one is missing.&lt;/p&gt;&lt;h2 id=&quot;step-1-export-your-strapi-project&quot;&gt;Step 1: Export your Strapi project&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx strapi export --file my-export --key &amp;quot;&amp;lt;the key&amp;gt;&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run this in the Strapi project, then move the file next to your Shapio project. It writes &lt;code&gt;my-export.tar.gz.enc&lt;/code&gt;, encrypted with the key. Keep the key, and once you have planned the import, leave the export file where it is until the import is done: the map step checks that the file has not changed.&lt;/p&gt;&lt;h2 id=&quot;step-2-plan-the-import&quot;&gt;Step 2: Plan the import&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx shapio import strapi my-export.tar.gz.enc --plan ./import --key &amp;quot;&amp;lt;the key&amp;gt;&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The plan runs offline and sends nothing anywhere. It unpacks the export into &lt;code&gt;./import/source&lt;/code&gt;, so the key is needed only once, writes the proposed models into &lt;code&gt;./import/schema&lt;/code&gt; and prints every model with its entry counts.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Collection type / single type becomes collection / single type, API ID from the singular name, plural kept&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Component becomes component, API ID from its name&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;uid&lt;/code&gt; becomes &lt;code&gt;uid&lt;/code&gt; (unique)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;float&lt;/code&gt; becomes &lt;code&gt;number&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;enumeration&lt;/code&gt; becomes &lt;code&gt;enum&lt;/code&gt;, or &lt;code&gt;string&lt;/code&gt; when the values are not valid API names&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;blocks&lt;/code&gt;, &lt;code&gt;richtext&lt;/code&gt; (Markdown) becomes rich text&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;media&lt;/code&gt; becomes &lt;code&gt;media&lt;/code&gt;, single or multiple, allowed kinds kept&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;relation&lt;/code&gt; becomes &lt;code&gt;relation&lt;/code&gt; (&lt;code&gt;one&lt;/code&gt; or &lt;code&gt;many&lt;/code&gt;) on the owning side&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Reserved names get a suffix, and the plan lists each one: Strapi&amp;#39;s example components &lt;code&gt;shared.media&lt;/code&gt; and &lt;code&gt;shared.rich-text&lt;/code&gt; become &lt;code&gt;mediaItem&lt;/code&gt; and &lt;code&gt;richTextItem&lt;/code&gt;. Every planned model has draft and publish on.&lt;/p&gt;&lt;p&gt;Validation rules are not carried over. Users, roles, API tokens, plugin content types, configuration and review workflows are not imported.&lt;/p&gt;&lt;h2 id=&quot;step-3-review-and-apply-the-schema&quot;&gt;Step 3: Review and apply the schema&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx shapio schema apply --dir ./import/schema --lock ./import/schema-lock.json&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Before applying, you can rename API IDs and labels or delete fields. Entries follow stable IDs, so renames are fine.&lt;/p&gt;&lt;p&gt;The models belong to the primary site, so your admin token works without &lt;code&gt;--site&lt;/code&gt;. To import into another site, plan with &lt;code&gt;--site &amp;lt;key&amp;gt;&lt;/code&gt;. To share the models with all sites, plan with &lt;code&gt;--shared&lt;/code&gt; and apply with a network admin token.&lt;/p&gt;&lt;h2 id=&quot;step-4-import-media-and-content&quot;&gt;Step 4: Import media and content&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx shapio import strapi --map ./import&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This uploads every upload file from the archive with its alternative text and caption, creates every document as a draft (referenced entries first), opens the change set and prints its link. It ends with a summary like this one:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Media: 11/11 uploaded. Entries: 18/18 created (3 stay drafts: they were not published in Strapi).&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A locale published in Strapi goes into the change set, and a draft-only locale stays a draft. The owning side of a relation is imported; you answer the inverse direction with a filter on the owning field.&lt;/p&gt;&lt;h2 id=&quot;step-5-review-and-ship-the-change-set&quot;&gt;Step 5: Review and ship the change set&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;https://cms.example.com/admin/s/default/changes/&amp;lt;id&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Open the link the map step printed (also under Changes in the admin). Each item shows its locale, the Publish action and its fields. Choose Ship, then Ship again in the confirmation. Everything goes live together as one snapshot, and the page shows &amp;quot;Shipped. Live as v1&amp;quot;.&lt;/p&gt;&lt;h2 id=&quot;check-it-worked&quot;&gt;Check it worked&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -H &amp;quot;Authorization: Bearer $SHAPIO_TOKEN&amp;quot; &amp;quot;$SHAPIO_URL/api/content/articles?populate=author&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Swap in the plural API ID of one of your models. Only entries that were published in Strapi come back, with their relations filled in. Add &lt;code&gt;&amp;amp;locale=fr&lt;/code&gt; to read another locale.&lt;/p&gt;&lt;p&gt;Check the rich text. Blocks map directly, with underline and strike-through dropped. In Markdown, strike-through loses its mark and raw HTML is unwrapped.&lt;/p&gt;&lt;h2 id=&quot;when-it-goes-wrong&quot;&gt;When it goes wrong&lt;/h2&gt;&lt;p&gt;&lt;code&gt;schema apply&lt;/code&gt; refuses with &lt;code&gt;FORBIDDEN_SCOPE&lt;/code&gt; if you planned with &lt;code&gt;--shared&lt;/code&gt; and the token belongs to one site. Use a network admin token, or plan again without &lt;code&gt;--shared&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;code&gt;--map&lt;/code&gt; refuses until the models exist, and names the missing ones and the apply command to run. It also refuses while a locale is missing, and names it: add it in Settings → Locales and run &lt;code&gt;--map&lt;/code&gt; again.&lt;/p&gt;&lt;p&gt;An existing model with the same API ID stops &lt;code&gt;schema apply&lt;/code&gt;. Rename the planned model&amp;#39;s API ID and plural API ID in its file, and any colliding component, then apply.&lt;/p&gt;&lt;p&gt;Re-running &lt;code&gt;--map&lt;/code&gt; skips finished work and retries what failed. It refuses if the export file changed since it was planned. &lt;code&gt;--plan&lt;/code&gt; never overwrites an import that has started: plan into a new directory to start over.&lt;/p&gt;&lt;p&gt;A Strapi 4 export is refused. Upgrade the project with &lt;code&gt;npx @strapi/upgrade major&lt;/code&gt;, then export again.&lt;/p&gt;&lt;p&gt;A set holds at most 2,000 items. A larger import opens numbered sets, &amp;quot;Import from Strapi (1/2)&amp;quot; and so on, which you ship one after another.&lt;/p&gt;&lt;p&gt;The rate limit is waited out automatically, but while a large &lt;code&gt;--map&lt;/code&gt; runs, the admin opened from the same address can answer &lt;code&gt;RATE_LIMITED&lt;/code&gt; for up to a minute.&lt;/p&gt;</content:encoded><category>Guide</category></item><item><title>Deploy a Shapio site to Cloudflare Pages and rebuild on publish</title><link>https://shapio.dev/blog/deploy-to-cloudflare-pages-and-rebuild-on-publish/</link><guid isPermaLink="true">https://shapio.dev/blog/deploy-to-cloudflare-pages-and-rebuild-on-publish/</guid><description>You will have a static Astro site on Cloudflare Pages that rebuilds when you publish, with deployment status tracked in Shapio.</description><pubDate>Sat, 03 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Cloudflare builds your site from Git, and Shapio starts each build through a deploy hook. Shapio follows the build through Cloudflare&amp;#39;s API so you can see whether published content reached the website.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Publish once and the deploy hook does the rest.&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;before-you-start&quot;&gt;Before you start&lt;/h2&gt;&lt;p&gt;You need a running Shapio with an owner account, installed through npm or Docker. Your Shapio must be reachable from the internet for Cloudflare to read content.&lt;/p&gt;&lt;p&gt;This guide uses the Astro starter, which produces static HTML. Next.js uses on-demand revalidation, while SvelteKit uses a full rebuild started by a deployment connection.&lt;/p&gt;&lt;h2 id=&quot;step-1-create-and-seed-your-site&quot;&gt;Step 1: Create and seed your site&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx create-shapio my-site --site astro
cd my-site&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This creates a standalone Astro project with the blog&amp;#39;s model files in &lt;code&gt;shapio/&lt;/code&gt;. Seed it against your running Shapio, using your address and owner credentials:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;SHAPIO_URL=https://cms.example.com SHAPIO_ADMIN_EMAIL=you@example.com SHAPIO_ADMIN_PASSWORD=&amp;#39;…&amp;#39; npm run seed&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The seed applies the models, uploads placeholder images, creates English and French content, and writes &lt;code&gt;SHAPIO_URL&lt;/code&gt; and &lt;code&gt;SHAPIO_DELIVERY_TOKEN&lt;/code&gt; to &lt;code&gt;.env&lt;/code&gt;. Open the admin: Content shows pages and articles, Models shows the models, and Media shows images.&lt;/p&gt;&lt;p&gt;Running the seed again resets the content; its temporary admin API token is revoked when it finishes. It also creates a &lt;code&gt;&amp;lt;site&amp;gt; dev&lt;/code&gt; token, written as &lt;code&gt;SHAPIO_DEV_DELIVERY_TOKEN&lt;/code&gt;, that can read drafts and must never go to production.&lt;/p&gt;&lt;h2 id=&quot;step-2-build-and-inspect-locally&quot;&gt;Step 2: Build and inspect locally&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npm run build
npm run preview&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The preview serves &lt;code&gt;dist/&lt;/code&gt; and prints its address, &lt;code&gt;http://localhost:4321/&lt;/code&gt; unless that port is taken. The home page redirects to &lt;code&gt;/en/&lt;/code&gt;, and the language switch leads to &lt;code&gt;/fr/&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Each build reads the current publication snapshot once and pins it, sending it with every request as &lt;code&gt;?snapshot=N&lt;/code&gt;. Content published during the build waits for the next build; &lt;code&gt;/build.json&lt;/code&gt; shows the built snapshot.&lt;/p&gt;&lt;h2 id=&quot;step-3-connect-cloudflare-pages-to-git&quot;&gt;Step 3: Connect Cloudflare Pages to Git&lt;/h2&gt;&lt;p&gt;Push &lt;code&gt;my-site&lt;/code&gt; to your own GitHub or GitLab repository, then select that repository in Cloudflare:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Workers &amp;amp; Pages → Create → Pages → Connect to Git
Framework preset: None
Build command: npm run build
Build output directory: dist
Root directory: leave empty&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The Astro preset works too; both give &lt;code&gt;npm run build&lt;/code&gt; and &lt;code&gt;dist&lt;/code&gt;. In Production environment variables, set &lt;code&gt;NODE_VERSION&lt;/code&gt; to &lt;code&gt;24&lt;/code&gt; and &lt;code&gt;SHAPIO_URL&lt;/code&gt; to your Shapio&amp;#39;s address, for example &lt;code&gt;https://cms.example.com&lt;/code&gt;. Set &lt;code&gt;SHAPIO_DELIVERY_TOKEN&lt;/code&gt; as a secret, using the token the seed wrote to &lt;code&gt;.env&lt;/code&gt; or one from Settings → API tokens with a delivery role that reads &lt;code&gt;page&lt;/code&gt;, &lt;code&gt;article&lt;/code&gt;, &lt;code&gt;author&lt;/code&gt; and &lt;code&gt;siteSettings&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Never set &lt;code&gt;SHAPIO_DRAFTS&lt;/code&gt; or &lt;code&gt;SHAPIO_DEV_DELIVERY_TOKEN&lt;/code&gt; in production. Click Save and Deploy: the first build runs and the site becomes live at &lt;code&gt;https://&amp;lt;project&amp;gt;.pages.dev&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;After the first build, turn on Settings → Builds → Build cache. The starter re-renders only the pages whose content changed and restores the rest from the previous build, and that needs the cache to survive between builds. Without it, every build is a full one.&lt;/p&gt;&lt;h2 id=&quot;step-4-create-the-hook-and-api-token&quot;&gt;Step 4: Create the hook and API token&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Workers &amp;amp; Pages → your Pages project → Settings → Builds → Deploy hooks → Add deploy hook
My Profile → API Tokens → Create Token → Custom token&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create the hook for the production branch and copy its URL. Give the custom token Account → Cloudflare Pages → Read, limited to your account, and copy the token.&lt;/p&gt;&lt;p&gt;Note the project name and account ID. You can find the account ID in the Workers &amp;amp; Pages overview&amp;#39;s right-hand column or the 32-character hex string in the dashboard URL.&lt;/p&gt;&lt;h2 id=&quot;step-5-add-the-deployment-connection&quot;&gt;Step 5: Add the deployment connection&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Publishing → Deployments → New connection → Cloudflare Pages&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enter the account ID, project name, deploy hook URL and API token, then select On publish and Manual. Test connection should pass: it checks that the token can read the project without starting a build.&lt;/p&gt;&lt;p&gt;You can enter the API token as &lt;code&gt;${ENV:SHAPIO_SECRET_CF_PAGES_TOKEN}&lt;/code&gt; instead. Set that variable for Shapio&amp;#39;s API and any dedicated worker; Shapio stores only the variable name and reads its value when needed.&lt;/p&gt;&lt;p&gt;With On publish selected, every publish starts a build. Bursts are coalesced, so ten publishes in a minute start one build.&lt;/p&gt;&lt;h2 id=&quot;step-6-set-up-draft-preview&quot;&gt;Step 6: Set up draft preview&lt;/h2&gt;&lt;p&gt;Set the connection&amp;#39;s preview URL template:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;https://&amp;lt;project&amp;gt;.pages.dev/preview/?model={modelKey}&amp;amp;id={entryId}&amp;amp;locale={locale}#token={token}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add &lt;code&gt;https://&amp;lt;project&amp;gt;.pages.dev&lt;/code&gt; to Shapio&amp;#39;s &lt;code&gt;CORS_ORIGINS&lt;/code&gt; and restart Shapio after changing it. The entry&amp;#39;s Preview opens the draft beside the document; clicking its title or body focuses that field.&lt;/p&gt;&lt;h2 id=&quot;check-it-worked&quot;&gt;Check it worked&lt;/h2&gt;&lt;p&gt;Publish something. The connection&amp;#39;s run should move through &lt;code&gt;triggered → building → deployed&lt;/code&gt;, with Cloudflare&amp;#39;s build log link and the snapshot it was started for. Open the site and check the change.&lt;/p&gt;&lt;p&gt;A Pages deploy hook cannot pass parameters, so the build pins the snapshot current when it starts.&lt;/p&gt;&lt;h2 id=&quot;when-it-goes-wrong&quot;&gt;When it goes wrong&lt;/h2&gt;&lt;p&gt;If a build is already queued for the branch, Cloudflare answers the hook with HTTP 304. Shapio follows that queued build and reports its result.&lt;/p&gt;&lt;p&gt;A provider that stops answering shows &lt;code&gt;unknown&lt;/code&gt;. Shapio does not invent completion status.&lt;/p&gt;&lt;p&gt;A wrong &lt;code&gt;SHAPIO_DELIVERY_TOKEN&lt;/code&gt; makes the build fail reading content with 401. Shapio shows &lt;code&gt;failed&lt;/code&gt;, the reason and the log link, while the content stays published. Restore the right token and Retry the run. Check that it deploys and the site shows the change.&lt;/p&gt;</content:encoded><category>Guide</category></item><item><title>Schema as code: pull your content model into git and apply it live</title><link>https://shapio.dev/blog/schema-as-code-pull-commit-apply/</link><guid isPermaLink="true">https://shapio.dev/blog/schema-as-code-pull-commit-apply/</guid><description>You will have canonical schema files and their lock file committed in git, ready to apply to production with a per-model version guard.</description><pubDate>Fri, 02 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Shapio syncs the models in an instance with JSON files so you can pull, edit and apply your content model. You can review changes in git while every environment, including production, remains editable in the admin by default (a read-only lock exists, and it is opt-in).&lt;/p&gt;&lt;h2 id=&quot;before-you-start&quot;&gt;Before you start&lt;/h2&gt;&lt;p&gt;You need an instance and an admin API token from Settings → API tokens. All &lt;code&gt;shapio schema&lt;/code&gt; commands talk to the instance over HTTP, never to its database. Supply &lt;code&gt;--url&lt;/code&gt; and &lt;code&gt;--token&lt;/code&gt;, or set &lt;code&gt;SHAPIO_URL&lt;/code&gt; and &lt;code&gt;SHAPIO_TOKEN&lt;/code&gt;. Run the commands in your Shapio project (the one &lt;code&gt;npm install @shapio/cms&lt;/code&gt; or &lt;code&gt;create-shapio&lt;/code&gt; set up), where &lt;code&gt;npx shapio&lt;/code&gt; finds the CLI; anywhere else, use &lt;code&gt;npx -p @shapio/cms shapio&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Choose a local or staging instance for modeling. Schema sync moves models only. To move or back up content, use &lt;code&gt;shapio export&lt;/code&gt; and &lt;code&gt;shapio import&lt;/code&gt;.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Git mirrors production; it never locks it.&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;step-1-pull-the-schema&quot;&gt;Step 1: Pull the schema&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;export SHAPIO_URL=https://cms.example.com SHAPIO_TOKEN=shp_…
npx shapio schema pull&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Pull writes one canonical JSON file per model and component, with sorted keys, stable IDs and every default spelled out. It also writes &lt;code&gt;.shapio/schema-lock.json&lt;/code&gt;, which records each definition&amp;#39;s version, hash and site, so commit both the schema files and the lock file.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;Pulled 8 definition(s) of site &amp;quot;default&amp;quot; at schema version 12 into schema&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;step-2-check-the-files-and-site&quot;&gt;Step 2: Check the files and site&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;schema/
  models/                 shared with all sites
  components/
  sites/
    blog/models/          the blog site&amp;#39;s own
    shop/models/          the shop site&amp;#39;s own
.shapio/schema-lock.json  every definition&amp;#39;s version, hash and site, and the sites the tree covers&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Shared definitions go in &lt;code&gt;schema/models/&amp;lt;apiKey&amp;gt;.json&lt;/code&gt; and &lt;code&gt;schema/components/&amp;lt;apiKey&amp;gt;.json&lt;/code&gt;, while a site&amp;#39;s own definitions go in &lt;code&gt;schema/sites/&amp;lt;siteKey&amp;gt;/models/&lt;/code&gt; and &lt;code&gt;schema/sites/&amp;lt;siteKey&amp;gt;/components/&lt;/code&gt;. Commands work on one site&amp;#39;s view: &lt;code&gt;--site &amp;lt;key&amp;gt;&lt;/code&gt; or &lt;code&gt;SHAPIO_SITE&lt;/code&gt; selects it, otherwise they use the token&amp;#39;s site, then the primary site.&lt;/p&gt;&lt;h2 id=&quot;step-3-edit-and-review-in-git&quot;&gt;Step 3: Edit and review in git&lt;/h2&gt;&lt;p&gt;Edit models in your local or staging admin. In the builder, Review in a change set queues the edit and Ship now ships it at once. Then pull, commit and open a pull request, or edit the JSON files directly. A new file may omit IDs: the instance assigns them on apply and rewrites the file in canonical form.&lt;/p&gt;&lt;h2 id=&quot;step-4-preview-and-apply-to-production&quot;&gt;Step 4: Preview and apply to production&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx shapio schema diff     # what apply would do; changes nothing
npx shapio schema apply&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With &lt;code&gt;SHAPIO_URL&lt;/code&gt; and &lt;code&gt;SHAPIO_TOKEN&lt;/code&gt; pointing to production, diff previews the changes and apply runs the same change planner as the admin, with checks, background index builds and atomic activation, without a restart. Apply waits for activation, then updates the lock file and applied files; &lt;code&gt;--no-wait&lt;/code&gt; returns at once, while &lt;code&gt;--wait-timeout &amp;lt;seconds&amp;gt;&lt;/code&gt; changes the default 600-second wait.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;model article: update
    + field subtitle
Applied 1 definition(s) at schema version 13.&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;step-5-choose-how-schema-and-content-ship&quot;&gt;Step 5: Choose how schema and content ship&lt;/h2&gt;&lt;p&gt;CLI apply activates each changed definition directly and does not create a change set. To ship schema and content together, use the admin instead. Develop → Schema saves edited files as drafts in a change set, after the same three-way check, and shipping that set publishes the schema and its content items as one snapshot. In the builder, Ship now ships a single edit as a one-item change set.&lt;/p&gt;&lt;h2 id=&quot;check-it-worked&quot;&gt;Check it worked&lt;/h2&gt;&lt;p&gt;Run &lt;code&gt;npx shapio schema diff&lt;/code&gt; again: it reports nothing to apply. Commit the updated lock file.&lt;/p&gt;&lt;h2 id=&quot;how-apply-decides&quot;&gt;How apply decides&lt;/h2&gt;&lt;p&gt;Apply compares the base in the lock file, your file and the target&amp;#39;s active definition for each model. If your file is unchanged, it skips the model and keeps live changes made since your pull. If only your file changed, it applies with the target&amp;#39;s current version as a guard. If both changed, it refuses and shows both sides. A file identical to the target is already applied and skipped.&lt;/p&gt;&lt;p&gt;The reverse workflow is valid too: edit production, then pull and reconcile. For automatic write-back, add a GitHub connection under Publishing → Deployments. After schema changes, it commits the canonical files and lock file, or opens a pull request from &lt;code&gt;shapio/schema-sync&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Check Develop → Snapshots for the schema version recorded with a snapshot. Metadata-only changes do not take a snapshot; conversions of stored values do. Older snapshots use the current schema, and restoring content does not roll back the schema.&lt;/p&gt;&lt;h2 id=&quot;when-it-goes-wrong&quot;&gt;When it goes wrong&lt;/h2&gt;&lt;p&gt;A conflict refuses the whole apply and writes nothing. The refusal looks like this:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;SCHEMA_SYNC_CONFLICT: The target schema changed since your last pull for some definitions you also changed. Pull, reconcile and apply again.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Commit your files, then run:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx shapio schema pull --force&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This overwrites files with the target&amp;#39;s definitions and records the new base. Use &lt;code&gt;git diff&lt;/code&gt; to bring your changes back on top, commit and apply again. Pull also refuses unapplied local edits unless you use &lt;code&gt;--force&lt;/code&gt;. After upgrading Shapio, pull again: a new version can add default properties to definitions, which changes their hashes.&lt;/p&gt;&lt;p&gt;Breaking changes need &lt;code&gt;--allow-breaking&lt;/code&gt;; destructive conversions need &lt;code&gt;--allow-destructive&lt;/code&gt;. Deleting a file does nothing on the target without &lt;code&gt;--prune&lt;/code&gt;, which still refuses deletion if the target definition changed.&lt;/p&gt;&lt;p&gt;For several sites, &lt;code&gt;LOCK_SITE_MISMATCH&lt;/code&gt; means you must pull the selected site first. &lt;code&gt;SCOPE_MISMATCH&lt;/code&gt; means the file&amp;#39;s folder disagrees with the instance: pull its layout. Changed shared definitions require schema permission on every site; &lt;code&gt;FORBIDDEN_SCOPE&lt;/code&gt; lists refused definitions and nothing applies. Check that the selected site&amp;#39;s tree and shared-definition permissions match the target before applying again.&lt;/p&gt;</content:encoded><category>Guide</category></item><item><title>What&apos;s left of the JAMstack</title><link>https://shapio.dev/blog/whats-left-of-the-jamstack/</link><guid isPermaLink="true">https://shapio.dev/blog/whats-left-of-the-jamstack/</guid><description>JAMstack is dead.</description><pubDate>Thu, 01 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;what-the-word-meant&quot;&gt;What the word meant&lt;/h2&gt;&lt;p&gt;JAMstack stood for JavaScript, APIs and Markup. Netlify&amp;#39;s founders coined it around 2016. The proposal was concrete: pre-render a site to static files, serve those files from a CDN, and use browser JavaScript and third-party APIs for anything dynamic.&lt;/p&gt;&lt;p&gt;Gatsby, Hugo, Jekyll, Eleventy and early Next.js static export belonged in that picture. Netlify and Vercel built businesses on it. Content came from Markdown files in the repository or from an API, and the API side is where headless CMSs grew up.&lt;/p&gt;&lt;h2 id=&quot;what-it-got-right&quot;&gt;What it got right&lt;/h2&gt;&lt;p&gt;Static files are fast, cheap and hard to hack. A CDN is a better front door than a PHP box. Those remain good reasons to build a site this way.&lt;/p&gt;&lt;p&gt;The build also gave you a reproducible artifact. You could pin it and roll it back. I put more value on that property than on whether a framework still fits an old acronym.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;A build is a reproducible artifact.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;The content API mattered just as much. Content could be the source for the site without being a database joined to templates.&lt;/p&gt;&lt;p&gt;Choosing an API for content does not settle whether every page should be static. It gives you a source to work from. Content delivery and page rendering are separate decisions.&lt;/p&gt;&lt;h2 id=&quot;how-it-went-wrong&quot;&gt;How it went wrong&lt;/h2&gt;&lt;p&gt;Build times grew with content. A ten-thousand-page site rebuilding for a typo is a concrete problem, whatever you call the architecture. A tidy deployment model doesn&amp;#39;t excuse that cost.&lt;/p&gt;&lt;p&gt;Every dynamic need became a function or a client-side fetch. Incremental regeneration and on-demand rendering were bolted on. Those additions made the original definition less useful as a guide to what a site actually does.&lt;/p&gt;&lt;p&gt;By now, every major framework renders on the server again. Next.js has the app router, Astro has server islands and on-demand pages, and SvelteKit and React Router (formerly Remix) are part of that server-rendered picture. Netlify itself stopped leading with the word JAMstack.&lt;/p&gt;&lt;p&gt;The term is dead; the useful parts have become standard practice. Describe which pages are built ahead of time, which need server rendering, and where their content comes from. That tells me more than the label does.&lt;/p&gt;&lt;h2 id=&quot;what-s-left&quot;&gt;What&amp;#39;s left&lt;/h2&gt;&lt;p&gt;Keep the build as an artifact you can pin and roll back. Keep static output wherever content changes slower than requests arrive. A long build is a reason to examine the build, not to discard static files everywhere else.&lt;/p&gt;&lt;p&gt;Keep a content API as the source. I don&amp;#39;t want the choice of templates to dictate where content lives. That preference doesn&amp;#39;t mean every site needs a headless CMS.&lt;/p&gt;&lt;p&gt;Rebuilding on publish is the other part worth keeping, with one correction. Publication is the point at which the content changes for readers, so that is the moment to produce pages. That part the old pattern got right.&lt;/p&gt;&lt;p&gt;What it got wrong was the scope. A typo rebuilt the whole site, and that is what people walked away from. That part is fixable now. Astro can restore every page whose content and code did not change and render only the rest, and a cached server-rendered site, like Next.js with cache tags, can expire just the pages a publish touched.&lt;/p&gt;&lt;p&gt;The dynamic parts can still be dynamic. Another part needing server rendering is no reason to abandon static output for content that suits it. Make that decision around the content and the request.&lt;/p&gt;&lt;h2 id=&quot;where-shapio-fits&quot;&gt;Where Shapio fits&lt;/h2&gt;&lt;p&gt;Shapio is built for the parts of this that held up. A build pins one publication snapshot (&lt;code&gt;?snapshot=N&lt;/code&gt;), so every page in it shows the same moment of content and schema. With a deployment connection, a publish fires the deploy hook and Shapio follows the build until it finishes. The site you are reading is built that way.&lt;/p&gt;&lt;p&gt;The scope problem is handled in the starters. The Astro starter keys every page on the content it renders, so a publish re-renders the pages that changed and restores the rest from the previous build, as long as the host keeps its build cache. The Next.js starter caches its reads by tag, and a publish expires only the tags of the content that changed.&lt;/p&gt;&lt;p&gt;The CMS itself never needs a deploy. Content types are data in the database: change one in the admin and the REST and GraphQL APIs serve the new field on the next request. Showing that field on the site is a change to the site&amp;#39;s code, which ships with the site&amp;#39;s next deploy.&lt;/p&gt;&lt;p&gt;For the parts that must be dynamic, the same content is on the API, and in a Next.js app &lt;code&gt;@shapio/local&lt;/code&gt; serves it in-process. Build the static pages on publish, and render on request only what needs it.&lt;/p&gt;</content:encoded><category>Opinion</category></item><item><title>Why headless</title><link>https://shapio.dev/blog/why-headless/</link><guid isPermaLink="true">https://shapio.dev/blog/why-headless/</guid><description>I want content to be data, the front end to be mine, and the schema to be a contract both sides can work against.</description><pubDate>Wed, 30 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;what-the-head-was&quot;&gt;What the head was&lt;/h2&gt;&lt;p&gt;A headless CMS stores and serves content through an API and leaves rendering to whatever front end you build. The head was the theme and the templates, the part that turned stored content into a page. Remove that part and you have content available to a separate application.&lt;/p&gt;&lt;h2 id=&quot;content-is-data&quot;&gt;Content is data&lt;/h2&gt;&lt;p&gt;My first reason is that content is data. An article has a title, a body, and whatever other fields its model defines. A page is a rendering of that article. Treating the article as data gives you a better starting point than treating its current page as the thing you are storing.&lt;/p&gt;&lt;p&gt;The same source can feed a site, an app, a feed, or a script. You do not have to enter the content again for each destination. Each consumer can take the fields it needs and decide what to do with them.&lt;/p&gt;&lt;p&gt;There is still work in each consumer. An API does not design your app or write your feed. That work belongs with the consumer, where the requirements for its output are clear.&lt;/p&gt;&lt;h2 id=&quot;the-front-end-is-yours&quot;&gt;The front end is yours&lt;/h2&gt;&lt;p&gt;My second reason is control over rendering. I want to choose the framework, the host, and how the front end produces its pages. I do not want a theme system making those decisions for me.&lt;/p&gt;&lt;p&gt;If you have worked with WordPress, you know what a theme is responsible for. Headless moves that responsibility into the front end you build. You own the templates because they are part of your application.&lt;/p&gt;&lt;p&gt;It also means the choice is yours to maintain. Choosing your own front end includes building it and taking responsibility for it. That is a reasonable trade when a team actually wants that control.&lt;/p&gt;&lt;h2 id=&quot;the-schema-is-the-contract&quot;&gt;The schema is the contract&lt;/h2&gt;&lt;p&gt;My third reason is the schema. The content model defines the API, and types follow from that model. The front end and the content team can agree on a shape instead of agreeing only on a page.&lt;/p&gt;&lt;p&gt;That changes what I want to discuss when modeling content. We need to agree on which fields belong to a type and which parts of the content should be shared. Those decisions describe the data the front end will receive.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;The schema is the contract.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;The front end depends on a shape, and changes to that shape need attention. Moving rendering out of the CMS does not remove the need for agreement.&lt;/p&gt;&lt;h2 id=&quot;a-service-with-an-api&quot;&gt;A service with an API&lt;/h2&gt;&lt;p&gt;A CMS should behave like any other service with an API. Your pages do not run through the CMS&amp;#39;s own code, whether that is WordPress&amp;#39;s PHP or anything else, and the site is not assembled from plugins that each bring their own data shapes, update cycle and attack surface.&lt;/p&gt;&lt;p&gt;The CMS stores and serves content, and the front end renders it. When something breaks, it is clear which side broke.&lt;/p&gt;&lt;h2 id=&quot;when-i-would-keep-the-head&quot;&gt;When I would keep the head&lt;/h2&gt;&lt;p&gt;For a brochure site with an editor who wants to drag things around a page and never touch code, and no developer building the site, I would keep the head. Building a separate front end adds a job that editor did not ask for. I would choose a tool that fits the way they want to work.&lt;/p&gt;&lt;p&gt;For a small shop where the storefront and the catalog are one product and nobody wants to build a front end, Shopify or WooCommerce handles it end to end. Headless pays off when the catalog feeds more than one storefront, which is why a headless e-commerce layer is on Shapio&amp;#39;s roadmap.&lt;/p&gt;&lt;p&gt;The same goes for any team with no developer. Headless gives you a front end to build. If nobody wants to build one, use the thing with the head.&lt;/p&gt;&lt;h2 id=&quot;changing-the-contract&quot;&gt;Changing the contract&lt;/h2&gt;&lt;p&gt;The usual headless cost arrives when the model changes. Strapi disables its content-type builder in production, and Payload defines fields in TypeScript. Model changes can mean code, commits, and a deploy.&lt;/p&gt;&lt;p&gt;Shapio&amp;#39;s position is that the model should be data too. Change a type in the admin while it runs in production, and the REST and GraphQL APIs serve the new field on the next request. There is no rebuild, restart, or deploy for that model change.&lt;/p&gt;&lt;p&gt;Schema and content ship together in a change set, recorded as a publication snapshot that a build can pin. Every page in the build then sees one consistent moment. That is the contract I want to build against.&lt;/p&gt;</content:encoded><category>Opinion</category></item></channel></rss>