How to Add Custom Environment Variables in React?

By Hemanta Sundaray on 2021-05-21

To define permanent environment variables, create a file called .env in the root of your project.

You must create environment variables beginning with REACT_APP.

client/src/.env
REACT_APP_STRIPE_KEY=pk_test_51I29RDy0e0059Iop568

Join the Newsletter