Skip to content
PluginStats

react-native-dotenv weekly downloads statistics

By dotenvx · npm · Babel plugins

Load .env into React Native with import statements. A Babel plugin that inlines environment variables at build time.

View on npm Fresh · Dec 6, 2026

react-native-dotenv has 438,011 recorded weekly downloads on npm, an increase of 15.5% over the past 30 days, ranking #414 of 3,247 tracked listings.

Weekly downloads
438,011
Official API · Dec 5, 2026
7-day growth
+19.0%
+69.9K weekly downloads
30-day growth
+15.5%
+58.8K weekly downloads
90-day growth
+43.0%
+131.7K weekly downloads
Rank
#414
▲ 10 in 7 days

About react-native-dotenv

react-native-dotenv NPM version downloads

<img src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.svg" alt="dotenv" align="right" width="200" />

Load .env into React Native with import statements. A Babel plugin that inlines your environment variables at build time — with multi-environment support.

 

Usage

Install it.

npm install react-native-dotenv --save-dev

Add it to your Babel config:

// babel.config.js
module.exports = function (api) {
  api.cache(false)
  return {
    plugins: [
      ['module:react-native-dotenv']
    ]
  }
}

Create a .env file in the root of your project:

# .env
HELLO="Dotenv"
API_URL=https://api.example.org

Import your environment variables:

// App.js
import { HELLO, API_URL } from '@env'

console.log(`Hello ${HELLO}`)
fetch(`${API_URL}/users`)

That's it. Your environment variables from .env are available via @env!

◇ injected env (2) from .env

 

Advanced

<details><summary>with the dotenv CLI</summary><br>

Use dotenv v18's dotenv run command when you want the same environment variables available to build tooling and your app's @env imports. The Babel plugin still inlines values into the app at build time.

Install dotenv directly so your package manager makes its CLI available to your project scripts:

npm install --save-dev dotenv@^18.0.1

Select a file when starting Metro:

{
  "scripts": {
    "start:staging": "dotenv run -f .env.staging -- react-native start --reset-cache"
  }
}
# .env.staging
API_URL=https://staging.example.org

Keep the Babel plugin configured as shown in Usage, then import normally:

import { API_URL } from '@env'

fetch(`${API_URL}/users`)

The CLI loads the selected file into the process environment before Metro starts. Existing shell/CI values win unless you pass --override to dotenv run. The plugin then gives non-empty process environment values priority over its own .env files.

The plugin still loads its usual files; -f selects the CLI's file, not the plugin's path or APP_ENV. This can change precedence: plain dotenv run loads .env into the process environment, so those values win over the plugin's .env.local values. Use the CLI when you intend its injected values to take priority.

With the default safe: false, keys loaded only by the CLI work through @env imports. With safe: true, those keys must also appear in files the plugin reads. Likewise, process.env.X is only inlined for keys in the plugin's files (plus NODE_ENV, BABEL_ENV, and envName).

Stop Metro and rerun the script after changing CLI-loaded values; its process environment is set at startup. The script resets Metro's cache when restarting.

The CLI is optional. For values used only by app code, the Babel plugin can continue loading .env files on its own.

</details> <details><summary>with Expo 🧭</summary><br>
// babel.config.js
module.exports = function (api) {
  api.cache(false)
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      ['module:react-native-dotenv']
    ]
  }
}
# .env
HELLO="Universe"
// app/index.tsx
import { HELLO } from '@env'
import { Text } from 'react-native'

export default function HomeScreen() {
  return <Text>Hello {HELLO}</Text>
}

Then start with a clean Metro cache: npx expo start --clear.

</details> <details><summary><code>envName</code> (default: <code>'APP_ENV'</code>)</summary><br>

Override which environment variable selects the mode file (separate from NODE_ENV). Metro can overwrite the test environment even if you specify a config, so this gives you a dedicated override.

// package.json
{
  "scripts": {
    "start:staging": "APP_ENV=staging npx react-native start"
  }
}

The above example would use the .env.staging file.

To use your own name:

{
  "plugins": [
    ["module:react-native-dotenv", {
      "envName": "MY_ENV"
    }]
  ]
}
// package.json
{
  "scripts": {
    "start:staging": "MY_ENV=staging npx react-native start"
  }
}

Note: if you're using APP_ENV (or envName), you cannot use development nor production as values, and you should avoid having a .env.development or .env.production. This is a Babel and Node thing that I have little control over unfortunately and is consistent with many other platforms that have an override option, like Gatsby. If you want to use development and production, you should not use APP_ENV (or envName), but rather the built-in NODE_ENV=development or NODE_ENV=production or you can just use debug vs release modes. It actually does compile but only for the start command so it is up to you but then you have to run react-native start every time you change the values.

</details> <details><summary><code>moduleName</code> (default: <code>'@env'</code>)</summary><br>

The module name used in import statements.

import { HELLO } from '@env'

For TypeScript or Next.js it is often advised to set moduleName to react-native-dotenv.

{
  "plugins": [
    ["module:react-native-dotenv", {
      "moduleName": "react-native-dotenv"
    }]
  ]
}
</details> <details><summary><code>path</code> (default: <code>'.env'</code>)</summary><br>

Path to the base env file.

{
  "plugins": [
    ["module:react-native-dotenv", {
      "path": ".env"
    }]
  ]
}
</details> <details><summary><code>allowlist</code> (default: <code>null</code>)</summary><br>

Limit imports to only these env variable names.…

Description from the npm listing.

  • dotenv
  • babel-plugin
  • babel
  • dotenv-flow
  • react
  • react-native
  • config
  • env
  • 12factor

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

react-native-dotenv weekly downloads on npm, last 90 days: 438,011 weekly downloads as of Dec 5, 2026, +43.0% over 90 days.react-native-dotenvWeekly downloads on npm · Last 90 days438,011downloads / week+43.0% over 90 days0100K200K300K400K500KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
react-native-dotenv weekly downloads on npm, last 90 days: 438,011 weekly downloads as of Dec 5, 2026, +43.0% over 90 days.

7/30/90-day growth

react-native-dotenv weekly downloads growth on npm: +19.0% over 7 days, +15.5% over 30 days, +43.0% over 90 days.react-native-dotenvWeekly downloads growth on npm438,011downloads / week now7-day growth+69,943 weekly downloads+19.0%30-day growth+58,790 weekly downloads+15.5%90-day growth+131,650 weekly downloads+43.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
react-native-dotenv weekly downloads growth on npm: +19.0% over 7 days, +15.5% over 30 days, +43.0% over 90 days.

Ranking history

react-native-dotenv npm ranking history: currently #414 (by weekly downloads).react-native-dotenvnpm ranking · by weekly downloads · Last 90 days#414current rank#100#150#200#250#300#350#400#450Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
react-native-dotenv npm ranking history: currently #414 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 21, #14 (overall #414)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins263 listings · 14 pages · page 11, #2 (overall #202)
Babel plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for react-native-dotenv
Date (UTC)Weekly downloadsChange vs. previous
438,011+6.7K
431,329+21K
410,341+23.1K
387,290+9.4K
377,893+7.2K
370,726+1.4K
369,280+1.2K
368,068-2.8K
370,823-3K
373,848-8.6K
382,420-5.2K
387,600+9.8K
377,798+8.4K
369,367—

Similar npm Babel plugins plugins

All 20 react-native-dotenv alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/react-native-dotenv. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.