friendsoftypo3 / headless
This extension provides way to output content from TYPO3 in JSON format.
Package info
github.com/TYPO3-Headless/headless
Type:typo3-cms-extension
pkg:composer/friendsoftypo3/headless
Fund package maintenance!
Requires
- php: >= 8.2
- ext-json: *
- typo3/cms-core: ^14.0
- typo3/cms-install: ^14.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.43
- friendsofphp/php-cs-fixer: ^v3
- helmich/typo3-typoscript-lint: ^v3
- justinrainbow/json-schema: ^5
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^2
- phpunit/phpcov: ^8 || ^9 || ^10
- seld/jsonlint: ^1.11
- symfony/yaml: ^6.1 || ^7.1
- typo3/cms-felogin: ^14.3
- typo3/cms-form: ^14.0
- typo3/cms-redirects: ^14.3
- typo3/cms-seo: ^14.3
- typo3/cms-workspaces: ^14.3
- typo3/coding-standards: ^0.8
- typo3/testing-framework: ^9.0
Suggests
None
Provides
None
Conflicts
- typo3/cms-core: <14.0
Replaces
None
- dev-master
- v5.0.0
- v5.0.0-rc2
- v5.0.0-rc1
- 4.x-dev
- v4.9.0
- v4.8.1
- v4.8.0
- v4.7.3
- v4.7.2
- v4.7.1
- v4.7.0
- v4.6.0
- v4.5.0
- v4.4.1
- v4.4.0
- v4.3.2
- v4.3.1
- v4.3.0
- v4.2.7
- v4.2.6
- v4.2.5
- v4.2.4
- v4.2.3
- v4.2.2
- v4.2.1
- v4.2.0
- v4.1.1
- v4.1.0
- v4.0.0
- v4.0.0-RC1
- 3.x-dev
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- v3.3.1
- v3.3.0
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0.0-beta
- 2.x-dev
- v2.7.2
- v2.7.1
- v2.7.0
- v2.6.0
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.0
- dev-task/set-version-4.9
- dev-task/back-port-fixes-from-v5
- dev-bugfixes/last-fixes
- dev-task/release-5.0.0
- dev-task/coverage-mysql-service
- dev-bugfix/624
- dev-task/919
- dev-documenation-fix
- dev-bugfixes/followup-fixes
- dev-task/v5-improvements
- dev-task/4-8-1
- dev-bugfix/891
- dev-bugfix/889
- dev-fix/887
- dev-feature/typo3-v14
- dev-Fix-docs
- dev-TASK/Migrate-documentation-rendering
- dev-documentation-draft
- dev-Update-to-version-4.2.3
- dev-add-video-to-readme
- dev-BUGFIX/Check-for-Site-in-middleware
- dev-BUGFIX/Fixes-to-php-cs-fixer
- dev-Update-emconf-to-3.4.0
This package is auto-updated.
Last update: 2026-11-30 17:42:30 UTC
README
Headless renders TYPO3 pages and content as JSON. You decide which fields are output, how they are named and nested, and what types they have, using plain TypoScript.
The extension is the backend part (JSON API) of the TYPO3 PWA solution. The frontend part is nuxt-typo3, a Vue.js/Nuxt application that consumes the API. Its documentation lives at https://t3headless.macopedia.io/nuxt-typo3. The JSON API works with any other frontend as well.
Features
- JSON API for pages, page metadata (SEO), content elements, menus and layouts
- respects the site's language and translation configuration (including fallbacks)
JSON,CONTENT_JSON,INT,FLOATandBOOLcontent objects for typed, nested output- headless-aware data processors (menus, files and images, galleries, FlexForms, database queries, root sites)
- full headless mode or mixed mode (Fluid HTML and JSON from the same site)
- separate frontend, API and file URLs per site, language and base variant
- installed core extensions are integrated automatically: EXT:form, EXT:felogin, EXT:redirects, EXT:seo
- workspace and page preview support
- easy to extend with custom fields, content elements and processors
Additional extensions and integrations
- EXT:news: headless_news
- EXT:solr: headless_solr
- EXT:powermail: headless_powermail
- EXT:container: headless-container-support and headless_container
- EXT:gridelements: headless_gridelements
- local development tweaks: headless_dev_tools
Check each extension for the TYPO3 and EXT:headless versions it supports.
Requirements and compatibility
| EXT:headless | Branch | TYPO3 | PHP | Status |
|---|---|---|---|---|
5.x |
master |
14 |
>= 8.2 |
Active development & support |
4.x |
4.x |
12, 13 |
>= 8.2 |
Bug & security fixes |
3.x |
3.x |
11 |
>= 7.4, <= 8.2 |
End of life |
2.x |
2.x |
9, 10 |
>= 7.2, <= 7.4 |
End of life |
Upgrading from 4.x? Read UPGRADE.md first. The default response changed in 5.0, and the friendsoftypo3/headless-legacy site set keeps the 4.x output.
Installation
Install the extension using Composer:
composer require friendsoftypo3/headless
Composer installation is recommended. In classic mode, unpack the release from TER into typo3conf/ext/headless.
Quickstart / Demo
For a working demo with frontend, backend and demo data, use the DDEV based demo project: https://github.com/TYPO3-Headless/pwa-demo
How to start with TYPO3 Headless (video tutorial)
An introduction to TYPO3 Headless for developers, content managers and anyone curious about it:
Configuration
Each site decides how it responds via two keys in its config/sites/<identifier>/config.yaml:
dependencies: - friendsoftypo3/headless headless: 1
Site set (dependencies): pick one
| Site set | Static include (sys_template) | Response |
|---|---|---|
friendsoftypo3/headless |
Headless | Trimmed default response (new projects) |
friendsoftypo3/headless-legacy |
Headless Legacy (4.x) | Full 4.x-compatible response (upgrades) |
friendsoftypo3/headless-mixed |
Headless - Mixed mode JSON response | Full 4.x-compatible response, served as JSON only for requests whose Accept header is exactly application/json |
Do not add a root sys_template record to a site using sets. Its "Clear" flags would wipe the TypoScript provided by the set. Sites without sets can include the matching static template in their root sys_template record instead.
Run mode (headless)
Set it in the YAML file or in the Sites module:
- 0: headless mode is deactivated for the site. Default value.
- 1: headless mode is fully activated for the site.
- 2: mixed mode. Fluid and the JSON API are both available within the site. Pair it with the mixed set.
In mixed mode TYPO3 responds with JSON only when the Accept header is exactly application/json. A list like Accept: application/json, text/plain, */* (the axios/fetch default) or application/json; charset=utf-8 gets the standard HTML response.
The legacy boolean values (true/false) still work because the flag is cast to an integer, but the integer notation is recommended.
Frontend and API URLs
If your frontend runs on a different domain than TYPO3, tell headless where it lives so links, preview URLs and file URLs in the response point to the right host:
base: https://api.example.com/ frontendBase: https://example.com/
frontendApiProxy, frontendFileApi and frontendFileApiByStorage (per file storage) cover API and file proxies. All of them can be overridden per base variant and per language. See Multi-site and URLs.
Feature flags and the rest of the options are described in the Configuration chapter.
JSON Content Object
The JSON content object lets you specify which fields to output and how they look:
lib.page = JSON
lib.page {
fields {
header = TEXT
header {
field = header
}
}
}
Output:
{
"header": "headerFieldValue"
}
Fields can be nested with another fields block:
lib.page = JSON
lib.page {
fields {
data {
fields {
foo = TEXT
foo {
field = bar
}
foo1 = TEXT
foo1 {
field = bar1
}
}
}
}
}
Output:
{
"data": {
"foo": "bar",
"foo1": "bar1"
}
}
Every field accepts any TypoScript content object (TEXT, COA, CASE, USER, ...), so you can override every part of the output.
INT, FLOAT & BOOL Content Objects
These content objects return real numbers and booleans, so the frontend does not have to deal with string values for numeric or true/false fields. They only work as fields inside a JSON content object.
lib.page = JSON
lib.page {
fields {
data {
fields {
foo = INT
foo {
# db value of foo_field = 1
field = foo_field
}
bar = BOOL
bar {
# db value of bar_field = 0
field = bar_field
}
}
}
}
}
Output:
{
"data": {
"foo": 1,
"bar": false
}
}
CONTENT_JSON renders content elements grouped by column (colPos). All properties are described in the TypoScript cObjects chapter.
Data processing
You can use data processors just like in the FLUIDTEMPLATE content object:
lib.languages = JSON
lib.languages {
dataProcessing {
10 = headless-language-menu
10 {
languages = auto
as = languages
}
}
}
By default the processor result replaces the fields output of the object. Set dataProcessingMerge = 1 to keep both:
lib.page = JSON
lib.page {
dataProcessingMerge = 1
fields {
title = TEXT
title.field = title
}
dataProcessing {
10 = headless-menu
10.as = mainMenu
}
}
Built-in data processors
Each processor is registered under a short identifier. The class name (namespace FriendsOfTYPO3\Headless\DataProcessing) works as well.
| Identifier | Processor | Purpose |
|---|---|---|
headless-menu |
MenuProcessor |
Navigation; works like the core menu processor |
headless-language-menu |
LanguageMenuProcessor |
Language switcher |
headless-files |
FilesProcessor |
Files and images, including processing and crop variants (Images) |
headless-gallery |
GalleryProcessor |
Media galleries; chain it after headless-files |
headless-database-query |
DatabaseQueryProcessor |
Records from the database |
headless-flex-form |
FlexFormProcessor |
FlexForm fields |
headless-extract-property |
ExtractPropertyProcessor |
Picks a single property from processed data |
headless-root-sites |
RootSitesProcessor |
Configuration of all headless sites for your frontend application |
Details and options: Data processors.
Example page response ⬇️
Documentation
The extension documentation covers configuration, custom content elements, images, caching, events, integrations (EXT:form, EXT:felogin, EXT:redirects) and a FAQ.
Contributing
Contributions are welcome. See CONTRIBUTING.rst and the Code of Conduct.
Development
This extension is developed as part of the TYPO3 PWA initiative. If you have any questions, join the #initiative-headless-pwa Slack channel.
Credits
Special thanks to macopedia.com, which sponsors the development of this solution.

