Skip to main content
Version: 5.x.x

Installation (React)


To get full image of working React integration check our React example application.

To install Tolgee React integration library run:

npm install @tolgee/react

Init Tolgee and wrap your application in TolgeeProvider.

import { Tolgee, DevTools, TolgeeProvider, FormatSimple } from "@tolgee/react";

const tolgee = Tolgee()
language: 'en',

// for development
apiUrl: process.env.REACT_APP_TOLGEE_API_URL,
apiKey: process.env.REACT_APP_TOLGEE_API_KEY,

// for production
staticData: {


fallback="Loading..." // loading fallback

Check Initialization for more info.

If you bootstrapped your application with Create React App, your .env.development.local file should look like this:


Never leak your API key! You don't want visitors of your site to edit your translations. That's why we recommend to use .env files to store your API key. API key is then omitted for production build.

Otherwise, you can set the properties directly, or you can use plugins like dotenv-webpack plugin.

Obtaining Tolgee API key is described in Integration chapter.

Preparing for production

In production mode, you should never use localization data from Tolgee REST API and never leak your API key. You should use data exported from the Tolgee platform or use Tolgee Content Delivery load localizations reliably.

Check Providing static data section.