- Dez. 1, 2026
- --
Your TypeScript skills now reach the Magnolia DXP backend
Your TypeScript skills now reach the Magnolia DXP backend
Magnolia in Aktion
Unser Expertenteam zeigt Ihnen live, was Magnolia für Sie leisten kann.
Jetzt Demo buchenKey insights
-
With Backend Live, a small backend change in Magnolia DXP is a TypeScript file you save, live on the next click, with no Java build and no restart.
-
It covers 15 extension points, from buttons, field checks and Global Search results in the apps to GraphQL fields, the JSON of the delivery API and the authentication of REST clients.
-
It's fast enough for every click in the editor: up to 8× faster than the previous major version on everyday work.
-
The code still runs inside Magnolia DXP, under the same permissions and workflows as Java code.
Every Magnolia DXP project has a list of small backend changes that nobody gets to. Editors want a button that only shows up on certain pages. The front end gets a whole page from the delivery API when all it needs is a title and a link.
The logic for each of these is a few lines. Shipping it takes a Java module, a Maven build, a deployment and a restart, usually done by someone other than the developer who asked for it. So the list grows, and the front-end team works around it.
Backend Live is how we shorten that list. You write the change in TypeScript, save the file, and Magnolia DXP runs the new code on the next click. It still runs on the server, inside Magnolia DXP, with the same content, users and permissions a Java extension would have, but the developer who needed the change can now write it and see it work a few seconds later.
Save the file, and it's live
A Backend Live project is an ordinary TypeScript project: you create one with npm create @magnolia/backend-live, which also asks which sample sets to start from, run the watch build, and point it at your Magnolia DXP instance. From then on, every save builds the changed script into a Light Module, the folder of files Magnolia DXP picks up without a deployment.
[Image of a change to a column script being typed and saved in VS Code, and the Pages app showing it without a restart (save-and-reload.gif)]
In the recording, the script behind a column in the Pages app gets one more call, .toUpperCase(). After the save, the page list reloads and the column shows its values in capitals, without a build of the webapp or a restart. It's the edit, save and reload routine front-end developers know from the browser, running on Magnolia DXP's server.
Fifteen places your code can plug in
Magnolia DXP has fixed places where custom code can take over, called extension points: when an editor clicks a button, when a dialog checks a field, when Global Search looks for results, when the delivery API writes its JSON, when a REST client prepares a request. Backend Live covers 15 of them, eleven more than its previous major version.
The samples that come with Backend Live include an availability rule that offers an action only on pages with a certain template, and a validator that keeps a page's abstract under a word limit and tells the editor how many words it has. A small content app for notes about pages shows the newest ones: its editor, built with Magnolia DXP's new forms, takes its options from scripts, and Global Search finds the notes through a script of its own. Others work outside the editor: a reference resolver turns a page reference into the link data a front end renders, a GraphQL data fetcher adds a computed field to a content type's GraphQL type, and a security scheme fetches an OAuth token for a REST client and keeps it until shortly before it expires.
The code reads like what you'd write for the browser. This is the logic of that validator:
validate(value: unknown): boolean | string | undefined {
// …
const words = String(value).trim().split(/\s+/).length;
const maxWords = Number(this.parameters.maxWords);
return words <= maxWords || `Use at most ${maxWords} words (this has ${words}).`;
}
Return true and the value passes. Return a string, and the editor sees it as the field's error message. Scripts can be async and call fetch, so a script that talks to your own APIs reads the way the same call would in a browser.
See every extension point at work
Pick the sample sets you want: each is a Light Module with working TypeScript scripts, their configuration and tests, and together they cover all 15 extension points.
Browse the samplesBuilt for production performance
Your scripts run on every click in the Magnolia DXP UI, so they have to be fast. Backend Live evaluates each script once and keeps it warm in a pool of script contexts; every call after that costs microseconds. Compared with the previous major version, on the same scripts:
And it's safe to call from any thread: concurrent requests each get their own script context.¹
Run Magnolia DXP on a GraalVM JDK and your scripts are compiled: about twice as fast again.²
Compared with the same extensions written in Java, a script call costs a few microseconds more (4 to 13 µs in the samples). A script that does real work, such as the sample command that imports JSON content, takes about three times as long as its Java version, and about one and a half times on GraalVM.³
¹ Measured with the released jars on an Apple M1 Pro, Temurin 21, Magnolia 6.4.11 core and the Backend Live samples; median of three runs of 3.2.0. A second round on 3.2.1 (median of five runs) gave the same figures or higher: 9.6×, 4.3–5.1×, 10× and 6.2×.
² GraalVM CE 25.0.2 against Temurin 21, same samples and machine.
³ Backend Live 3.2.1 against the same samples written in Java, same machine; median of three runs. The JSON import command takes 220 µs as a script and 70 µs in Java on Temurin 21, and 91 µs and 63 µs on GraalVM CE 25.0.2.
Your own tools, down to the breakpoint
Because a Backend Live project is a TypeScript project, the rest of your setup comes with it. A script's parameters are typed, so your editor completes them, and the compiler catches a misspelled one before Magnolia DXP ever sees it. Tests run in Node, without an instance. When you need the next script, npx backend-live create writes it from a template, together with the configuration that wires it into Magnolia DXP. That configuration is generated from a small TypeScript file next to each script; if your team would rather review YAML, one command turns it into hand-written YAML for good.
When something doesn't behave, set a breakpoint in the .ts file in VS Code or IntelliJ IDEA and click the button in Magnolia DXP. The request waits while you step through the script and look at its values.
Speed without giving up control
Scripts plug into Magnolia DXP's own extension points, so permissions and publishing workflows apply to them as they do to Java extensions, and the scripts go through the same code review as the rest of the project.
When a script fails, it fails its own call and is logged with its file name. A voter that throws abstains instead of blocking requests, and a resolver that throws leaves the original value in place. The debugger lives in a module of its own, meant for a development-only build. Secrets such as a client secret can reach a script from Magnolia's Password Manager or from the environment, so they don't have to sit in configuration files in your repository.
Get started
To try Backend Live, you need a Magnolia DXP 6.4 instance with the Backend Live modules, which is one Maven dependency, and Node on your machine. npm create @magnolia/backend-live asks which sample sets to include, so your first project can start with a working script for every extension point you're interested in. The documentation walks through the rest.
Start building with Backend Live
Installation, all 15 extension points, and working samples are in the documentation.
Read the docs