Note: This documentation is for version 1 of the Vercel platform. For the latest features, please see the version 2 documentation. If you have yet to upgrade, see the upgrade guide.

Environment Variables

Almost every app needs to get configurations at runtime. These configurations could be anything, including:

  • Database connection details
  • Third-party API keys
  • Different customization parameters

The best way to expose these configurations is to do so with environment variables, which is a universally available method that works across various programming languages, operating systems and hosting providers.

Exposing environment variables with Now is easy.


You can expose environment variables with the -e flag.


You can then access them inside your app.
If your app is a Node.js app, here's how you can do that:

const { MONGO_URL, MY_API_TOKEN } = process.env

Via now.json

You can also expose these environment variables with now.json. For that, create a file named now.json inside your app root and add environment variables like this:

  "env": {
    "MONGO_URL": "",

After that, now will use above environment variables when you deploy your app.

It's not a good idea to commit the now.json file to Git if it contains secret information. For that, consider using Secrets.