Skip to content
 
 

Latest commit

 

History

45 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adding spoonacular API key using vite dotenv

Official documentation

Create a .env.local file.

  • In Vite, using .env.local automatically ensures git ignores it unlike using .env
  • Add a variable for your api key VITE_API_KEY=insert api key here in .env.local
/ * the VITE_ prefix is necessary for vite to to expose the api key in client */

// Example api keys in .env.local
VITE_API_KEY=09ej03918g0287h
VITE_RANDOM_KEY=168hnf18gy198ghy9

// Calling the api key in react
const apiKey = import.meta.env.VITE_API_KEY;

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages