---
title: "Reading configuration outside a frontend request"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:extbase-no-frontend-configuration@main"
source: "ExtensionArchitecture/Extbase/NoFrontendContext/Configuration.rst"
rendered: "2026-10-25T17:00:55+00:00"
---

# Reading configuration outside a frontend request {#extbase-no-frontend-configuration}

Extbase settings are only available while Extbase dispatches a plugin or a
backend module, see [Accessing settings outside a controller](https://docs.typo3.org/permalink/t3coreapi:extbase-configuration-settings-outside-controller@main). Code that runs anywhere
else reads its configuration from a source that exists in its context.

## Frontend TypoScript outside the frontend {#extbase-no-frontend-configuration-frontend-typoscript}

In backend contexts (such as backend modules,) CLI commands, or scheduler tasks,
frontend TypoScript is either not loaded or behaves unpredictably. Backend
requests lack an active frontend user session and page context, while handling
record visibility flags such as `starttime`, `endtime`,
`hidden`, and workspace overlays differently. Attempting to evaluate
frontend TypoScript in the backend triggers unnecessary overhead and leads to
unreliable results.

## Global configuration: use site settings {#extbase-no-frontend-configuration-site-settings}

If a configuration value does not belong to a specific content element or
plugin instance, but applies globally to a site or extension (for example, API
keys, external endpoint URLs, or global defaults), Extbase TypoScript settings
are usually not the best place for it.

Instead, use [site settings](https://docs.typo3.org/permalink/t3coreapi:sitehandling-settings@main). Site settings can be
retrieved in any service, middleware, or console command using the
`\TYPO3\CMS\Core\Site\Entity\Site` object:

**Reading a site setting**

```php
$apiKey = $site->getSettings()->get('myExtension.apiKey');
```

The site object can be obtained from the PSR-7 request
(`$request->getAttribute('site')`) or by injecting
`\TYPO3\CMS\Core\Site\SiteFinder`. See
[Accessing site settings in PHP and Fluid](https://docs.typo3.org/permalink/t3coreapi:sitehandling-settings-access@main)
for details.

This requires knowing which site to load. In a frontend request the site has
already been resolved. Without one, `\TYPO3\CMS\Core\Site\SiteFinder`
needs a site identifier or a page uid to find the site. When neither is known,
or when a value is the same for every site, other sources fit better:

-   TypoScript remains a valid place for such values. Without the Extbase
    configuration manager, it can be read in a frontend request through the
    [frontend.typoscript request attribute](https://docs.typo3.org/permalink/t3coreapi:typo3-request-attribute-frontend-typoscript@main), once the frontend has
    prepared it. `getFlatSettings()` returns the TypoScript constants
    and is always available there. `getSetupArray()` returns the setup,
    but throws an exception on a page delivered from the page cache. Outside a
    frontend request, TypoScript is not built for the request.
-   The extension configuration needs no request, no site and no page, see
    [Installation-wide configuration: use extension configuration](https://docs.typo3.org/permalink/t3coreapi:extbase-no-frontend-configuration-extension-configuration@main).

## Installation-wide configuration: use extension configuration {#extbase-no-frontend-configuration-extension-configuration}

A value that is the same for every site, or that is needed where no site is
known, belongs in the [extension configuration](https://docs.typo3.org/permalink/t3coreapi:extension-options@main).
`\TYPO3\CMS\Core\Configuration\ExtensionConfiguration` reads it without a
request, a site or a page:

**Reading an extension configuration value**

```php
$newRecordPid = (int)$extensionConfiguration->get('my_extension', 'newRecordPid');
```

Administrators set these values in **System > Settings**. The
conferences backend module uses one for the page it creates new records on,
see [Creating records from an Extbase backend module](https://docs.typo3.org/permalink/t3coreapi:extbase-backend-module-editing-new@main).
