---
title: "Reference: Events"
manual: "Headless"
version: "main"
permalink: "https://docs.typo3.org/permalink/friendsoftypo3/headless:ref-events@main"
source: "Reference/Events.rst"
rendered: "2026-10-14T09:29:03+00:00"
---

# Reference: Events {#ref-events}

PSR-14 events dispatched by `EXT:headless`. For registration syntax
and a worked example see [Events you can listen to](https://docs.typo3.org/permalink/friendsoftypo3/headless:developer-events@main).

## EnrichFileDataEvent {#enrichfiledataevent}

`FriendsOfTYPO3HeadlessEventEnrichFileDataEvent`

Fired by `FileUtility::process()` once a file's default properties
have been collected, before crop variants and `autogenerate` derive
extra fields. The canonical hook for adding custom file fields
(signed URLs, focus point, alt-text overrides) to **every** file in
the response.

| Method | Returns |
| --- | --- |
| `getProperties(): array` | The current property bag (mutable via set). |
| `setProperties(array): void` | Replace the property bag. |
| \`getProcessed(): FileInterface | The processed file (after FAL). |
| `getOriginal(): FileInterface` | The original file reference. |
| `getProcessingConfiguration()` | `ProcessingConfiguration` value object. |

## FileDataAfterCropVariantProcessingEvent {#filedataaftercropvariantprocessingevent}

`FriendsOfTYPO3HeadlessEventFileDataAfterCropVariantProcessingEvent`

Fired once per file, after all crop variants have been processed (and
also when the file has none). Use it to post-process the complete file
payload including its `cropVariants`. The event carries the base
per-file `ProcessingConfiguration` that was passed into
`processCropVariants()` — the per-variant configurations derived
inside the loop never reach the event.

| Method | Returns |
| --- | --- |
| `getProcessedFile(): array` | The whole processed-file payload. |
| `setProcessedFile(array): void` | Replace it. |
| `getOriginal(): FileInterface` | The original file reference. |
| `getProcessingConfiguration()` | The per-file `ProcessingConfiguration` (not per-variant). |

## Core events you may also care about {#core-events-you-may-also-care-about}

These come from TYPO3 core but are commonly used alongside headless:

-   `TYPO3CMSRedirectsEventRedirectWasHitEvent` — headless's
    `HeadlessRedirectResponseListener` (identifier
    `headless/RedirectWasHit`) builds the JSON redirect envelope from
    this event. Register your own listener `after` it to replace the
    response — see [EXT:redirects](https://docs.typo3.org/permalink/friendsoftypo3/headless:integrations-redirects@main).
-   `TYPO3CMSFrontendEventAfterCacheableContentIsGeneratedEvent` —
    the headless `AfterCacheableContentIsGeneratedListener` listens to
    this to bake SEO meta tags into the JSON response. Listen too if
    you need to post-process the full encoded JSON before it goes into
    the page cache.
-   `TYPO3CMSFrontendEventModifyHrefLangTagsEvent` — headless's
    `HeadlessHreflangGeneratorListener` rewrites hreflang URLs through
    `UrlUtility`.
-   `TYPO3CMSFrontendEventAfterLinkIsGeneratedEvent` — headless's
    `AfterLinkIsGeneratedListener` rewrites typolink URLs through
    `UrlUtility`.
-   `TYPO3CMSCoreRoutingEventAfterPageUriGeneratedEvent` —
    headless's `AfterPageUriGeneratedListener` rewrites the host on
    URIs produced by `PageRouter::generateUri()` — BE "view" links,
    workspace split-screen previews and similar admin tooling land on
    the configured `frontendBase`. It acts only on backend requests
    and only when headless mode is enabled for the resolved site.
-   `TYPO3CMSCoreResourceEventGeneratePublicUrlForResourceEvent` —
    headless's `ProxyResourcePublicUrlListener` (identifier
    `headless/ProxyResourcePublicUrl`) rewrites public URLs of local,
    publicly capable storages through the configured storage proxy.
    Registered only when the `headless.storageProxy` feature flag is
    enabled, and acts only on frontend requests with headless mode on.
-   `TYPO3CMSFrontendLoginEventLoginConfirmedEvent` — headless
    assigns the `success` status to the JSON login response.

See [Events you can listen to](https://docs.typo3.org/permalink/friendsoftypo3/headless:developer-events@main) for listener registration syntax.
