Skip to main content

phrase/i18next-phrase-backend

@phrase/i18next-backend is a backend plugin for i18next that fetches translations from Phrase OTA at runtime. It works with any JavaScript framework that uses i18next — React, Vue, Angular, Node.js, React Native, and others. The plugin caches translations locally and re-fetches when the cache expires, minimizing requests to the Phrase CDN.
This guide applies to v2+ of the SDK.

Installation

Setup

Both distribution and environment are available in the Phrase Strings dashboard after creating a distribution, or via the Distributions API.

Configuration options

React Native

The backend has no built-in storage on React Native, so pass an AsyncStorage-compatible implementation via the storage option. Any storage exposing getItem, setItem, and clear (returning Promises) works.
For projects that target both React Native and web via react-native-web, passing AsyncStorage works on both — its web build is backed by localStorage. Alternatively, omit storage and the package auto-detects localStorage on web.

Managing releases

Create and publish releases using the Strings API or the Phrase Strings dashboard. To publish releases automatically on a schedule, use release triggers.