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/sdkpnpm add @babelize/sdkyarn add @babelize/sdkbun add @babelize/sdkReact
For React applications, import the React bindings from the SDK's /react subpath — one install, no extra packages:
npm install @babelize/sdkimport { BabelizeProvider, useBabelize } from "@babelize/sdk/react";pnpm add @babelize/sdkyarn add @babelize/sdkbun add @babelize/sdk
reactandreact-domare 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/sdkimport { babelizeRSC, loadLockfile, babelizeMiddleware } from "@babelize/sdk/next";pnpm add @babelize/sdkyarn add @babelize/sdkbun add @babelize/sdk
nextis 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/sdkSee 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/vitepnpm add -D @babelize/viteyarn add -D @babelize/vitebun add -D @babelize/viteNext.js:
npm install -D @babelize/nextpnpm add -D @babelize/nextyarn add -D @babelize/nextbun add -D @babelize/nextReact Native / Expo (Metro):
npm install -D @babelize/metrobun add -D @babelize/metroAPI Key
Get your API key from the Babelize Dashboard. Set it as an environment variable:
export BABELIZE_API_KEY=bblz_sk_xxxxxxxxxOr add it to your .env file:
BABELIZE_API_KEY=bblz_sk_xxxxxxxxxBABELIZE_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