Decoupled Settings
A decoupled Drupal site cannot read its own basic settings over JSON:API. Site name, slogan, front page, theme logo and favicon all live in simple config, and core JSON:API is entity based, so there is no resource to expose them. Decoupled Settings fills that gap: it reads the global values from the config objects that already hold them, and lets each consumer sparsely override individual settings. One backend, many frontends, each rendering as its own site.
Features
- Global values are read in place. There is no second copy of the site name to drift or sync.
- A consumer stores only the settings it overrides. Everything else is inherited and follows the site value. An override set to an empty value stays empty, and clearing it restores inheritance.
- Exposure is bounded twice: an administrator lists which config objects are exposed, and typed config schema decides which keys within them appear. An exclusion list removes the rest, with the site email address excluded by default.
- Theme logo and favicon arrive as resolved URLs, from core's own theme settings resolution.
- Responses carry the config cache tags of every object read, and cache contexts for both consumer negotiation mechanisms.
- Other modules can contribute computed settings through an alter hook, per-consumer overridable like everything else.
Post-Installation
Configure the exposure list at Configuration > Web services > Decoupled Settings. Config objects are added from a list, and a review table shows exactly what a frontend will read, including unsaved changes. Per-consumer overrides are edited on the consumer itself, on its Settings tab. Grant the Read decoupled settings permission to whoever may read: the anonymous role for public data, or a role reachable through an OAuth2 scope for protected data.
Additional Requirements
- Drupal 10.3 or 11, PHP 8.3 or later
- JSON:API (Drupal core)
- Consumers
- JSON:API Resources
Recommended modules/libraries
Simple OAuth works with no extra setup: it identifies the consumer from the access token, so an authenticated app resolves its own overrides with the token alone.
Similar projects
- JSON:API Basic Site Settings serves a fixed, hardcoded key list from one controller, with no cacheability metadata and unresolved logo paths. This module supersedes it.
- Config Pages and Site Settings and Labels model settings as entities, which suits editorial values with no core config equivalent. They cannot reach the settings core already stores, so using them for the site name means a second copy of it.
- JSON:API Extras reshapes resources JSON:API already produces. Simple config is not an entity, so there is nothing for it to reshape.
- Consumer Image Styles is the pattern this module extends, for image styles only and with no global layer.