Skip to content

Add configurable API suffix - #8392

Merged
sneridagh merged 2 commits into
mainfrom
configurable-api-suffix
Jul 22, 2026
Merged

sneridagh merged 2 commits into
mainfrom
configurable-api-suffix

Conversation

@sneridagh

Copy link
Copy Markdown
Member

What changed

Adds a configurable API traversal suffix for Volto.

  • Introduces config.settings.apiSuffix, with RAZZLE_API_SUFFIX as its environment-variable counterpart.
  • Centralizes suffix resolution in getApiSuffix() and uses it across API URL formatting, backend URL expansion, authenticated resource requests, and sitemap requests.
  • Keeps existing behavior by default: Volto continues to use /++api++.
  • Gives an explicitly configured apiSuffix precedence over legacyTraverse.
  • Supports an empty suffix (RAZZLE_API_SUFFIX='' or apiSuffix: '') to intentionally omit traversal.
  • Hydrates RAZZLE_API_SUFFIX from window.env so seamless-mode runtime configuration stays consistent between SSR and browser requests.
  • Adds feature Towncrier entries for both @plone/volto and @plone/types, and documents the new environment variable.

Why

Volto currently chooses only between the fixed /++api++ suffix and no suffix through legacyTraverse.
Deployments that expose the Plone API under another traversal suffix need a supported configuration option without relying on the legacy traversal switch.

Impact

Integrators can configure a nonstandard API traversal suffix through config.settings.apiSuffix or RAZZLE_API_SUFFIX.
The setting overrides legacyTraverse when present, while existing installations retain their current behavior when it is absent.

Validation

  • pnpm --filter @plone/volto test --run src/helpers/Url/Url.test.js src/helpers/Api/Api.plone.rest.test.js src/helpers/Api/PloneBackendAPIResourceWithAuth.test.js
    • 109 tests passed.
  • pnpm --filter @plone/types check:ts
    • passed.
  • Prettier check passed for the changed source, type, documentation, and test files.
  • Commit hooks passed, including package lint/format checks and the i18n check.
  • pnpm --filter @plone/volto check:ts still reports existing unrelated typing errors in widget and Storybook files; no errors are associated with this change.

@sneridagh
sneridagh marked this pull request as ready for review July 22, 2026 08:01
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 volto | 🛠️ Build #33702451 | 📁 Comparing a0f2fc9 against latest (7f1c249)

  🔍 Preview build  

2 files changed
± genindex.html
± configuration/environmentvariables.html

@sneridagh
sneridagh merged commit 2371d41 into main Jul 22, 2026
79 of 80 checks passed
@sneridagh
sneridagh deleted the configurable-api-suffix branch July 22, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant