BabelizeBabelize
SDK

Installation

Install the Babelize SDK packages for the core runtime, React, Next.js and React Native, add the build plugins for your bundler, and set up your API key.

Core Runtime

The core SDK has no framework dependencies and works in any JavaScript environment.

npm install @babelize/sdk
pnpm add @babelize/sdk
yarn add @babelize/sdk
bun add @babelize/sdk

React

For React applications, import the React bindings from the SDK's /react subpath — one install, no extra packages:

npm install @babelize/sdk
import { BabelizeProvider, useBabelize } from "@babelize/sdk/react";
pnpm add @babelize/sdk
yarn add @babelize/sdk
bun add @babelize/sdk

react and react-dom are optional peer dependencies — they're only required when you import from @babelize/sdk/react.

Next.js

For Next.js applications with server-side rendering and edge middleware, import from the SDK's /next subpath — still one install:

npm install @babelize/sdk
import { babelizeRSC, loadLockfile, babelizeMiddleware } from "@babelize/sdk/next";
pnpm add @babelize/sdk
yarn add @babelize/sdk
bun add @babelize/sdk

next is an optional peer dependency — only required when you import from @babelize/sdk/next.

React Native & Expo

The same package and /react subpath work in Expo and bare React Native apps (no DOM APIs):

npx expo install @babelize/sdk

See React Native & Expo for loading translations and the device language.

Build Plugins

Install the build plugin for your framework as a dev dependency.

Vite:

npm install -D @babelize/vite
pnpm add -D @babelize/vite
yarn add -D @babelize/vite
bun add -D @babelize/vite

Next.js:

npm install -D @babelize/next
pnpm add -D @babelize/next
yarn add -D @babelize/next
bun add -D @babelize/next

React Native / Expo (Metro):

npm install -D @babelize/metro
bun add -D @babelize/metro

API Key

Get your API key from the Babelize Dashboard. Set it as an environment variable:

export BABELIZE_API_KEY=bblz_sk_xxxxxxxxx

Or add it to your .env file:

BABELIZE_API_KEY=bblz_sk_xxxxxxxxx

BABELIZE_API_KEY is a secret. It is read by the build plugins and server-side code only. Do not expose it to the browser: never prefix it with VITE_ or NEXT_PUBLIC_, and never pass it to babelize.init() in client code. In the browser, call babelize.init() without a key and load translations from the lockfile.

Last updated: 2026-10-16

How is this guide?

On this page