Skip to content Skip to sidebar Skip to footer

How To Read Environmental Variables From .env File In Firebase?

The easiest, multiplaform way to store environmental variables is by using .env file in the root of our project. Now, the problem I'm facing is related to Firebase, more precisely

Solution 1:

The Firebase CLI deploys everything in the functions folder at the time of deployment, except for node_modules. If it's not in there for deployment, you won't be able to read it at all without somehow going off-host to a remote network location. There is currently no way to make the CLI merge in files from other locations. You could perhaps try a symlink.

unless the .env was manually copied to the deployable functions folder.

This is probably what you'll have to end up doing.

Post a Comment for "How To Read Environmental Variables From .env File In Firebase?"