{"id":30553,"date":"2023-09-17T16:45:41","date_gmt":"2023-09-17T16:45:41","guid":{"rendered":"https:\/\/alexrusin.com\/?p=30553"},"modified":"2023-10-07T09:58:02","modified_gmt":"2023-10-07T17:58:02","slug":"runtime-environment-variables-in-javascript","status":"publish","type":"post","link":"https:\/\/blog.alexrusin.com\/runtime-environment-variables-in-javascript\/","title":{"rendered":"Environment Variables in JavaScript"},"content":{"rendered":"\n

Environment variables in JavaScript are a set of key-value pairs that can be used to store data outside of the JavaScript code. This data can be anything from API keys to database credentials. Environment variables are often used to keep sensitive data secret, as they are not stored in the code itself.<\/p>\n\n\n\n

We can import environment variables in the code with process.env<\/em> object.<\/p>\n\n\n\n

export API_KEY=YOUR_API_KEY<\/code><\/pre>\n\n\n\n
\n