@hyperlocalise/ota loads a CDN distribution at runtime, so copy changes reach users without a new build. It works with any i18n library: the SDK returns plain message objects, and your library formats them. It has no dependencies and runs in browsers, Node 18+, React Native, Deno, Bun, and edge runtimes.
Install
How it works with your library
Every integration follows the same three steps:- Create one client for the app.
- Load a locale’s messages with
getMessages(locale)and give them to your library. - Reload when a release goes out:
subscribeto the client and give the library the new messages.
getMessages returns flat keys, exactly as they are in your source files:
{{name}}, or any other placeholder syntax reaches your library as written. Libraries that look keys up by path need nested objects. Wrap the result in unflattenMessages:
react-intl
getMessages resolves.
next-intl
Load messages on the server ini18n/request.ts. The client lives at module level, so requests share its cache, and it checks for a new release at most every 15 minutes. Don’t call startPolling on the server.
i18next
Add each namespace as a resource bundle. A namespace is a distributed file’s basename:/checkout.json is checkout.
keySeparator, pass unflattenMessages(messages) to addResourceBundle instead.
vue-i18n
svelte-i18n
Any other library
Anything that accepts a messages object at runtime works the same way. Load withgetMessages(locale), call unflattenMessages if the library expects nesting, and pass the result to the library’s “set” or “add messages” function. Run that function again in a subscribe listener.
Libraries that compile catalogs at build time, such as Lingui, need their runtime compiler to use OTA strings.
Loading and locales
getMessages(locale) merges every file in the distribution for that locale. Pass { namespace: "checkout" } to read only /checkout.json. App locales resolve to the closest distribution locale: fr, fr_FR, and fr-CA all find fr-FR. getLocales() lists the distribution’s locales.
Bundled fallbackMessages sit under OTA strings, so keys missing from the release still show your shipped copy.
New releases
The client reuses a manifest for 15 minutes and fetches locale files only when the releasetimestamp changes. startPolling() checks on that interval, and subscribe listeners run when a new release is found. You can set a longer pollIntervalMs, but not a shorter one. refresh() checks right away and resolves true when there is a new release.
Offline and revoked hashes
In browsers the release is saved in
localStorage. On servers it is kept in memory. In React Native, pass AsyncStorage:
onError to log errors the client recovers from.
Custom S3 destinations
Pass the destination’s public base URL. The SDK requests{baseUrl}/{hash}/manifest.json:
api.hyperlocalise.com when public-api.hyperlocalise.com is unreachable.
Other formats
getMessages reads the JSON format. For Android XML or iOS strings distributions, getContent(locale) returns each file’s path, namespace, and raw body.

