npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-dot-env

v0.0.1

Published

Add .env support to your react-native application without exposing them in JavaScript bundle.

Readme

React Native dotenv

Add .env support to your react-native application without including credentials in JavaScript bundle.

npm version npm downloads

Package that loads environment variables from a .env file into process.env. Credentials are not included in the JavaScript bundle, instead credentials that are bundled in the native app are exposed to the Javascript. It's a much more secure way for you application to access credentials, especially when JavaScript bundles are being remotely downloaded. You can easily use .env file and let build process create platform specific configuration files.

NOTE: Android not supported yet, feel free to contribute :)

Installation

yarn add react-native-dot-env
# or
npm install --save react-native-dot-env

Automatically link

react-native link react-native-dot-env

Manually link

iOS with CocoaPods

Add the following line to your build targets in your Podfile

pod 'RNDotEnv', :path => '../node_modules/react-native-dot-env/ios'

Then run pod install

Android

Sorry, Android is not supported yet.

Getting started

  1. Create a new React Native App
react-native init SimpleApp
cd SimpleApp
  1. Install the latest version of react-native-dot-env
yarn add react-native-dot-env
# or via npm
# npm install --save react-native-dot-env
react-native link react-native-dot-env
  1. Create .env file(s) and add them to .gitignore
echo "API_URL=http://localhost" > .env
touch ios/.env.plist
echo ".env*" >> .gitignore
  1. Add newly created .env.plist to Xcode project
  • open ios/SimpleApp.xcodeproj
  • In Project navigator right click on project SimpleApp (root item) and choose Add Files to "SimpleApp"
  • Add the newly created .env.plist (in MacOS you can show hidden files with ⌘+shift+.)

Add file

  1. Add Run script in Project Build phases
  • It has to be before Copy Bundle resources (see image)
node ../node_modules/react-native-dot-env/cli.js -e ../.env -d $SRCROOT

Build phases

  1. Add to application source code
import dotenv from 'react-native-dot-env'

dotenv()

console.log(process.env)
  1. Run App
react-native run-ios