npm / i18next-http-backend
i18next-http-backend
What changed in i18next-http-backend 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-25.
12 breaking7 security1 new APIs and options1 performance2 behavior and defaults1 tooling8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initi18next-http-backend 420 changes
Breaking changes 8
Requests are refused when a URL’s scheme or authority differs from the template produced by loadPath or addPath, preventing plain lng or ns values from redirecting requests.
Values containing &, = or ; are rejected to prevent query parameter pollution when lng is interpolated into query-shaped loadPath or addPath templates.
Values containing &, = or ; are rejected to prevent query parameter pollution when ns is interpolated into query-shaped loadPath or addPath templates.
Values containing
:are now rejected to prevent URL injection when a loadPath or addPath template starts with a placeholder.Values containing
:or//are now rejected to prevent URL injection when a loadPath or addPath template starts with a placeholder.The minimum supported Node version is now 18, so projects using older Node versions must upgrade or stay on v3.x.
The backend no longer provides cross-fetch and requires a host-provided fetch; runtimes without native fetch need a ponyfill injected through options.alternateFetch or must stay on v3.x.
XHR and ActiveXObject are still detected when provided by the host, but are no longer polyfilled.
Security 2
The interpolated URL is now checked as a whole, preventing requests to protocol-relative URLs when loadPath or addPath templates do not start with // or \.
i18next-http-backend incomplete URL validation permits SSRF
New APIs and options 1
Use options.alternateFetch to inject a fetch ponyfill, mock fetch in tests, or intercept requests.
Performance 1
The package declares sideEffects as false, enabling downstream bundlers to apply tree-shaking accordingly.
Behavior and default changes 2
With i18next 26.7.1 or later, reloads current and clone-loaded languages and retries bundles that failed to load.
With i18next 26.7.0 or later, reloads use services.utils.reloadResources, including i18next's retries and the loaded event; the same fallback and preload languages are reloaded.
Fixes and other changes 6
Errors thrown by a fetch request callback are rethrown instead of being passed to the callback a second time, avoiding duplicate reads and incorrectly failed namespaces.
The backend declares its callback API so i18next 26.7.0 or later calls read and create with callbacks and passes create its options.
Query string parameters are added before a URL fragment in loadPath and addPath, so the server receives them; URLs without fragments are unchanged.
Synchronous XHR errors are now passed to the callback, allowing i18next to take its usual failed-load path instead of leaving init() unresolved.
When a loadPath function’s promise rejects, the error is reported to i18next through its usual failed-load path, and init() resolves instead of hanging or causing an unhandled rejection in Node.
Allows
@innsvalues so scoped-package-style namespace names fetch correctly;@remains blocked forlng.
i18next-http-backend 311 changes
Breaking changes 4
Request URLs are no longer built when lng values contain unsafe URL or path characters, control characters, prototype keys, or exceed 128 characters; legitimate i18next language-code shapes remain supported.
Request URLs are no longer built when ns values contain unsafe URL or path characters, control characters, prototype keys, or exceed 128 characters.
Backend path interpolation supports only {{lng}} and {{ns}}; custom interpolation prefix and suffix from i18next config no longer apply.
Backend path interpolation supports only {{lng}} and {{ns}}; custom interpolation prefix and suffix from i18next config no longer apply.
Security 5
addQueryString iterates only own enumerable keys and guards against prototype keys, preventing prototype-pollution amplification into URLs.
The customHeaders loop in XHR mode iterates only own enumerable keys and guards against prototype keys, preventing prototype-pollution amplification into request headers.
Control characters are stripped from lng, ns, and URL values before they appear in error-callback strings, preventing log forging.
URLs are redacted to remove user:password credentials before they appear in error-callback strings, preventing basic-auth credential leaks.
i18next-http-backend has Path Traversal & URL Injection via Unsanitised lng/ns
Fixes and other changes 2
Namespace values can contain forward slashes again, allowing nested namespace names to fetch correctly through loadPath.
The fetch-options-stripping fallback is scoped to one backend instance, so a not-implemented fetch error no longer strips requestOptions from other instances in the process.
i18next-http-backend 21 changes
Tooling 1
TypeScript support was updated for the major i18next version.