{
  "@type": "HeadlessPages",
  "@id": "/_api/headless_pages/2000",
  "uid": 2000,
  "title": "tca-api-headless",
  "slug": "/",
  "seo_title": "",
  "description": "Headless page delivery for TYPO3: composed pages, typed content, navigation and SEO meta as JSON.",
  "no_index": 0,
  "no_follow": 0,
  "canonical_link": null,
  "og_title": "",
  "og_description": null,
  "og_image": [
    {
      "uid": 2000,
      "name": "proof-sheet.jpg",
      "extension": "jpg",
      "publicUrl": "https://typo3.example/fileadmin/_processed_/6/7/csm_proof-sheet_b029d99fcd.jpg",
      "mimeType": "image/jpeg",
      "fileSize": 109399,
      "metadata": {
        "title": null,
        "alternative": "Proof sheets on cyan, yellow, magenta and white paper, printed with colour blocks and halftone fields, fanned out on a light table, one lifted to show a ruled grid underneath",
        "description": null,
        "copyright": null
      },
      "width": 1536,
      "height": 806
    }
  ],
  "breadcrumbs": [
    {
      "uid": 2000,
      "title": "tca-api-headless",
      "nav_title": "",
      "url": "https://typo3.example/website/",
      "doktype": 1
    }
  ],
  "languages": [
    {
      "languageId": 0,
      "locale": "en-US",
      "hreflang": "en",
      "title": "English",
      "url": "https://typo3.example/website/",
      "available": true,
      "active": true
    },
    {
      "languageId": 1,
      "locale": "de-DE",
      "hreflang": "de",
      "title": "German",
      "url": "https://typo3.example/website/de/",
      "available": true,
      "active": false
    }
  ],
  "meta": {
    "robots": "index,follow",
    "canonical": "https://typo3.example/website/",
    "schema": {
      "@context": "https://schema.org",
      "@type": "WebPage",
      "url": "https://typo3.example/website/",
      "name": "tca-api-headless",
      "inLanguage": "en",
      "description": "Headless page delivery for TYPO3: composed pages, typed content, navigation and SEO meta as JSON."
    },
    "alternates": [
      {
        "hreflang": "en",
        "href": "https://typo3.example/website/"
      },
      {
        "hreflang": "de",
        "href": "https://typo3.example/website/de/"
      },
      {
        "hreflang": "x-default",
        "href": "https://typo3.example/website/"
      }
    ]
  },
  "regions": {
    "hero": [
      {
        "uid": 2000,
        "CType": "textmedia",
        "header": "This page is a TYPO3 page.",
        "header_layout": 0,
        "header_position": "",
        "header_link": null,
        "subheader": "",
        "bodytext": [
          {
            "_type": "block",
            "_key": "k0",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k1",
                "marks": [],
                "text": "Every sentence here was written in a TYPO3 page tree and delivered as JSON by "
              },
              {
                "_type": "span",
                "_key": "k2",
                "marks": [
                  "strong"
                ],
                "text": "tca-api-headless"
              },
              {
                "_type": "span",
                "_key": "k3",
                "marks": [],
                "text": ": composed pages, typed content elements, navigation and SEO meta for any frontend. Each proof shows the request, the JSON and the TypeScript type behind a section."
              }
            ]
          },
          {
            "_type": "block",
            "_key": "k4",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k5",
                "marks": [
                  "code"
                ],
                "text": "composer require maikschneider/tca-api-headless:dev-main \\\n  \"maikschneider/tca-api:dev-main as 2.4.0\""
              }
            ]
          }
        ],
        "assets": [
          {
            "uid": 2000,
            "name": "proof-sheet.jpg",
            "extension": "jpg",
            "publicUrl": "/fileadmin/website/proof-sheet.jpg",
            "mimeType": "image/jpeg",
            "fileSize": 109399,
            "metadata": {
              "title": null,
              "description": null
            }
          }
        ],
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2004,
        "CType": "header",
        "header": "Start in five steps",
        "header_layout": 0,
        "header_position": "",
        "header_link": {
          "href": "https://typo3.example/website/quick-start",
          "target": null,
          "title": "Quick start"
        },
        "subheader": "",
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2005,
        "CType": "header",
        "header": "Source on GitHub",
        "header_layout": 0,
        "header_position": "",
        "header_link": {
          "href": "https://github.com/maikschneider/tca-api-headless",
          "target": "_blank",
          "title": "tca-api-headless on GitHub"
        },
        "subheader": "",
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      }
    ],
    "story": [
      {
        "uid": 2001,
        "CType": "text",
        "header": "Editors stay in TYPO3",
        "header_layout": 0,
        "header_position": "",
        "header_link": null,
        "subheader": "",
        "bodytext": [
          {
            "_type": "block",
            "_key": "k0",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k1",
                "marks": [],
                "text": "Page tree, backend layouts, content elements and translations work the way editors know them. Nothing changes in the backend: the frontend receives the page as it was composed, as data instead of HTML."
              }
            ]
          },
          {
            "_type": "block",
            "_key": "k4",
            "style": "normal",
            "markDefs": [
              {
                "_key": "k2",
                "_type": "link",
                "href": "https://typo3.example/website/quick-start",
                "target": null,
                "title": null
              },
              {
                "_key": "k3",
                "_type": "link",
                "href": "https://typo3.example/kettenblatt/",
                "target": null,
                "title": "A fictional bicycle workshop"
              }
            ],
            "children": [
              {
                "_type": "span",
                "_key": "k5",
                "marks": [],
                "text": "Start with the "
              },
              {
                "_type": "span",
                "_key": "k6",
                "marks": [
                  "k2"
                ],
                "text": "quick start"
              },
              {
                "_type": "span",
                "_key": "k7",
                "marks": [],
                "text": ", or see the same API render the "
              },
              {
                "_type": "span",
                "_key": "k8",
                "marks": [
                  "k3"
                ],
                "text": "Kettenblatt specimen site"
              },
              {
                "_type": "span",
                "_key": "k9",
                "marks": [],
                "text": "."
              }
            ]
          }
        ],
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2006,
        "CType": "text",
        "header": "Frontends get typed data",
        "header_layout": 0,
        "header_position": "",
        "header_link": null,
        "subheader": "",
        "bodytext": [
          {
            "_type": "block",
            "_key": "k0",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k1",
                "marks": [],
                "text": "Content elements arrive in "
              },
              {
                "_type": "span",
                "_key": "k2",
                "marks": [
                  "em"
                ],
                "text": "regions"
              },
              {
                "_type": "span",
                "_key": "k3",
                "marks": [],
                "text": ", named by the column identifiers of the backend layout. Rich text arrives as Portable Text, bullets as lists, tables as rows. Links are absolute and already point to the right language."
              }
            ]
          }
        ],
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2007,
        "CType": "text",
        "header": "The contract is generated",
        "header_layout": 0,
        "header_position": "",
        "header_link": null,
        "subheader": "",
        "bodytext": [
          {
            "_type": "block",
            "_key": "k0",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k1",
                "marks": [],
                "text": "TCA API describes every resource of a site in an OpenAPI document, including the regions and content types this extension adds. Generate TypeScript types from it and let CI fail when frontend and TYPO3 drift apart. Every type in the proofs on this page was generated that way."
              }
            ]
          }
        ],
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2008,
        "CType": "text",
        "header": "Opt-in per site",
        "header_layout": 0,
        "header_position": "",
        "header_link": null,
        "subheader": "",
        "bodytext": [
          {
            "_type": "block",
            "_key": "k0",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k1",
                "marks": [],
                "text": "Add the site set to every site that should deliver headless pages; sites without it serve none of its resources. A few site settings cover region names, menu depth and content types outside the catalog."
              }
            ]
          }
        ],
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      }
    ],
    "features": [
      {
        "uid": 2009,
        "CType": "bullets",
        "header": "How a page travels",
        "header_layout": 0,
        "header_position": "",
        "header_link": null,
        "subheader": "",
        "bullets_type": 2,
        "bodytext": [
          {
            "term": "TYPO3",
            "definition": "Editors compose the page from content elements in the page tree, in every language of the site."
          },
          {
            "term": "tca-api-headless",
            "definition": "Reads the page through TCA API and answers with JSON: regions, content, navigation and meta."
          },
          {
            "term": "Your frontend",
            "definition": "A static build, a server or an app fetches the page and renders it with generated types."
          }
        ],
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2002,
        "CType": "table",
        "header": "What a response carries",
        "header_layout": 0,
        "header_position": "",
        "header_link": null,
        "subheader": "",
        "bodytext": {
          "head": [
            "Field",
            "What the frontend gets"
          ],
          "body": [
            [
              "regions",
              "Content elements, grouped by the column identifiers of the backend layout"
            ],
            [
              "bodytext",
              "Portable Text, list items or table rows, depending on the content type"
            ],
            [
              "header_link",
              "A link object with href, target and title"
            ],
            [
              "meta",
              "Robots, a canonical URL in the request language and a schema.org WebPage"
            ],
            [
              "og_image",
              "An absolute URL to the processed social image"
            ],
            [
              "navigation",
              "A menu tree with absolute URLs, limited by a depth setting"
            ],
            [
              "?path=",
              "The page uid behind a URL path, in the request language"
            ]
          ],
          "foot": []
        },
        "table_caption": "",
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": "",
        "table_header_position": 1
      }
    ],
    "cta": [
      {
        "uid": 2090,
        "CType": "text",
        "header": "From composer to the first response",
        "header_layout": 0,
        "header_position": "",
        "header_link": null,
        "subheader": "",
        "bodytext": [
          {
            "_type": "block",
            "_key": "k0",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k1",
                "marks": [],
                "text": "Require the package: "
              },
              {
                "_type": "span",
                "_key": "k2",
                "marks": [
                  "code"
                ],
                "text": "composer require maikschneider/tca-api-headless:dev-main \"maikschneider/tca-api:dev-main as 2.4.0\""
              }
            ],
            "listItem": "number",
            "level": 1
          },
          {
            "_type": "block",
            "_key": "k3",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k4",
                "marks": [],
                "text": "Add the site set "
              },
              {
                "_type": "span",
                "_key": "k5",
                "marks": [
                  "code"
                ],
                "text": "maikschneider/tca-api-headless"
              },
              {
                "_type": "span",
                "_key": "k6",
                "marks": [],
                "text": " to the dependencies in the site's "
              },
              {
                "_type": "span",
                "_key": "k7",
                "marks": [
                  "code"
                ],
                "text": "config.yaml"
              },
              {
                "_type": "span",
                "_key": "k8",
                "marks": [],
                "text": "."
              }
            ],
            "listItem": "number",
            "level": 1
          },
          {
            "_type": "block",
            "_key": "k9",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k10",
                "marks": [],
                "text": "Give the columns of your backend layout identifiers such as "
              },
              {
                "_type": "span",
                "_key": "k11",
                "marks": [
                  "code"
                ],
                "text": "main"
              },
              {
                "_type": "span",
                "_key": "k12",
                "marks": [],
                "text": ". They become the region names."
              }
            ],
            "listItem": "number",
            "level": 1
          },
          {
            "_type": "block",
            "_key": "k13",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k14",
                "marks": [],
                "text": "Request a page: "
              },
              {
                "_type": "span",
                "_key": "k15",
                "marks": [
                  "code"
                ],
                "text": "curl https://example.org/_api/headless_pages/1"
              }
            ],
            "listItem": "number",
            "level": 1
          },
          {
            "_type": "block",
            "_key": "k16",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k17",
                "marks": [],
                "text": "Write the OpenAPI document of the site and generate types from it:"
              }
            ],
            "listItem": "number",
            "level": 1
          },
          {
            "_type": "block",
            "_key": "k18",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k19",
                "marks": [
                  "code"
                ],
                "text": "vendor/bin/typo3 tca-api:openapi main --output openapi.json\nbunx openapi-typescript openapi.json -o src/api/schema.d.ts"
              }
            ]
          },
          {
            "_type": "block",
            "_key": "k20",
            "style": "normal",
            "markDefs": [],
            "children": [
              {
                "_type": "span",
                "_key": "k21",
                "marks": [],
                "text": "tca-api-headless is in development. It needs TCA API 2.4 and TYPO3 13.4 or 14.3."
              }
            ]
          }
        ],
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2003,
        "CType": "header",
        "header": "Read the full quick start",
        "header_layout": 0,
        "header_position": "",
        "header_link": {
          "href": "https://typo3.example/website/quick-start",
          "target": null,
          "title": "Five steps to the first request"
        },
        "subheader": "",
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2091,
        "CType": "header",
        "header": "Documentation",
        "header_layout": 0,
        "header_position": "",
        "header_link": {
          "href": "https://github.com/maikschneider/tca-api-headless/tree/main/Documentation",
          "target": "_blank",
          "title": "Documentation on GitHub"
        },
        "subheader": "",
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2092,
        "CType": "header",
        "header": "GitHub",
        "header_layout": 0,
        "header_position": "",
        "header_link": {
          "href": "https://github.com/maikschneider/tca-api-headless",
          "target": "_blank",
          "title": "Source code on GitHub"
        },
        "subheader": "",
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      },
      {
        "uid": 2093,
        "CType": "header",
        "header": "Packagist",
        "header_layout": 0,
        "header_position": "",
        "header_link": {
          "href": "https://packagist.org/packages/maikschneider/tca-api-headless",
          "target": "_blank",
          "title": "maikschneider/tca-api-headless on Packagist"
        },
        "subheader": "",
        "layout": 0,
        "frame_class": "default",
        "space_before_class": "",
        "space_after_class": ""
      }
    ]
  }
}