Toolvito

Calculates on this device. File exports run online.

React Native Environment File Checker

Paste or open the .env file of your app, and if you like its .env.example and some code. Choose how the app reads the file and press Check the .env file. The page lists every problem with its line. It never shows a value: only whether a key is filled.

Enter your values

Finds mistakes in a .env file, keys that are missing from it or from .env.example, and keys that the code reads but the file does not set.

Your values

It is read in this browser. The results never show a value, only whether a key is filled.

The list of keys that the app needs, usually without values.

Paste a file or two of the app. For the whole project use the box below.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

The code of a whole project (scanned on the server)

Scan the code of a whole project

Uses the key names of the check above (never the values). Choose code files (.js, .jsx, .ts, .tsx) or ZIPs of the code folders without .env files, up to 20 files. You get problems.csv, usage.csv (every place that reads a variable) and keys.csv.

Or drop files here. JS, JSX, TS, TSX, MJS, CJS or ZIP, up to 20 files, 200 MB each at most.

    The check above works in your browser and no value of your .env files ever leaves it. When you use the box below, the code files or ZIPs you choose there are sent to the Toolvito server with only the key names and line numbers of the .env file and .env.example above, and the way the app reads them. A .env file in the list or inside a ZIP stops the task before anything is sent. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

    How to check a .env file

    1. Open the .env file in the first box. It is read in this browser.
    2. Add .env.example to find keys that are missing on one side, and code to find keys that the code reads but the file does not set.
    3. Choose Expo, react-native-config, react-native-dotenv or dotenv: each has its own rules.
    4. Press Check the .env file. To check the code of a whole project, use the box below: it receives only the key names.

    What is checked in the file

    • Each line must be KEY=value, with an optional export in front; # starts a comment line. A key has letters, digits and _ (a key with - or . or a digit first cannot be read as process.env.KEY).
    • Quotes: a value in ', " or a backtick may run over several lines; a quote that is never closed takes the rest of the file into the value.
    • Comments: dotenv stops a value at #, so key#2 is read as key. Put such a value in quotes.
    • Empty values and keys that are set twice (dotenv keeps the last one).
    • react-native-config wants plain KEY=value lines: its README warns that a stray space can break reading, so spaces, export and values over several lines are marked.
    • Expo: values of variables named EXPO_PUBLIC_… are visible in plain text in the compiled app, so names with SECRET, PRIVATE or PASSWORD, and private keys, are marked.

    What is checked in the code

    • Expo puts only variables named EXPO_PUBLIC_… into the code of the app, and replaces only process.env.EXPO_PUBLIC_KEY written with a dot: process.env['EXPO_PUBLIC_KEY'] and const { EXPO_PUBLIC_KEY } = process.env are not replaced (Expo docs, “Environment variables”).
    • react-native-config: Config.KEY after import Config from 'react-native-config' (also under another name).
    • react-native-dotenv: import { KEY } from '@env' (or the module name you set in its moduleName option), and process.env.KEY.
    • Comments, strings and regular expressions are skipped, so text such as 'process.env.X' in a string is not counted. A name worked out while the app runs, such as process.env[name], cannot be checked and is listed as a note.

    Make a .env.example

    Choose Make a .env.example to get the same keys and comments with every value left out. Read the comments before you share the file: a comment may hold a value.

    Limits you should know

    • The file is read by the rules of dotenv. Each library has its own reader, and react-native-config reads the file in its own native build steps, so a line that passes here can still fail there.
    • Variables expanded inside a value (such as ${OTHER}) are not worked out.
    • The code is read word by word, not run or fully parsed; very unusual code can be missed.
    • Keys that the app gets from somewhere else (a build server, EAS, the shell) are not known here and may show as not set.

    Related tools