Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,075 of 9,075 pages
About the help in other languages
All help pages

Headless with the DXP

Planning a headless project on Exponential Platform DXP - which API for which client, authentication per client, CORS, caching, previews, images and the content model as an API contract - with a checklist for the first…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/dxp-developers/headless-with-the-dxp.md

On this page

Headless with the DXP

This page is for developers and architects who use the DXP as a content back end for other clients: a single-page application, a mobile app, a static site generator, a kiosk. Editors keep working in /adminui/; your clients read (and sometimes write) through the APIs.

Contents

  1. Which API for which client
  2. The content model is your API
  3. Authentication per client
  4. Images
  5. Caching
  6. Previews and links
  7. First-release checklist

Which API for which client

Client needsChooseWhy
Exactly the fields of a screen, few round tripsGraphQLOne query, the fields you ask for
Create and update content, upload filesRESTFull create, update and delete on the repository
A server-rendered siteTwig in the DXP itselfNo API at all

Both can be used side by side.

The content model is your API

Content type identifiers and field identifiers become GraphQL types and fields, and appear in REST responses. Agree them with client developers before editors fill content, version changes like an API, and regenerate the GraphQL schema in the same change (GraphQL).

Authentication per client

  • Public, read-only content: anonymous requests, limited by the Anonymous role.
  • Apps and services: one user per client, a role with only the policies it needs, JWT tokens (JWT authentication).
  • Browsers on another origin: allow exactly their origins with CORS_ALLOW_ORIGIN (The REST API, CORS).

Images

Clients should request variations, never originals. Define variations for the sizes your clients show (Image variations); include the width and height in what you send.

Caching

Anonymous GET requests go through the HTTP cache, which the DXP purges when content changes (HTTP cache and Varnish). Authenticated requests are personal; cache them in the client, not in a shared proxy.

A decoupled front end needs its own routes for content. Decide early how a location maps to a client URL (for example by the URL alias the API returns) and how editors preview drafts; the DXP's preview in /adminui/ renders with the site's Twig templates, not with your client.

First-release checklist

  • To do: The API prefix is read from configuration in every client (Where it lives).
  • To do: Every client has its own user and a minimal role.
  • To do: JWT keys are generated on every environment and backed up.
  • To do: CORS lists only your origins.
  • To do: The GraphQL schema is committed and matches the content types.
  • To do: Image variations exist for every size a client shows.
  • To do: Anonymous responses are cached and purged on publish.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x