-
-
Save indreklasn/d1087cca693cad1b2a4cd12cca3b4b38 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a .env file at your project root: | |
// add your variables: | |
VITE_API_KEY=your_api_key_here | |
// Accessing Environment Variables: | |
// In your Vite project, you can access the environment variable directly: | |
const apiKey = import.meta.env.VITE_API_KEY; | |
// webpack: | |
REACT_APP_API_KEY=your_api_key_here | |
// accessing variables: | |
const apiKey = process.env.REACT_APP_API_KEY; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment