<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by ray kudjie on Medium]]></title>
        <description><![CDATA[Stories by ray kudjie on Medium]]></description>
        <link>https://medium.com/@rkudjie?source=rss-7c58c9ea926c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9s7iTvRWtooPp2Qk.</url>
            <title>Stories by ray kudjie on Medium</title>
            <link>https://medium.com/@rkudjie?source=rss-7c58c9ea926c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 04:07:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rkudjie/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How To add Environment Variables to To your Vue-Cli projects]]></title>
            <link>https://medium.com/@rkudjie/how-to-add-environment-variables-to-to-your-vue-cli-projects-699f7a93f11c?source=rss-7c58c9ea926c------2</link>
            <guid isPermaLink="false">https://medium.com/p/699f7a93f11c</guid>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vue-cli]]></category>
            <dc:creator><![CDATA[ray kudjie]]></dc:creator>
            <pubDate>Fri, 13 Sep 2019 23:07:31 GMT</pubDate>
            <atom:updated>2019-09-13T23:07:31.722Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I was working on a side project using Vue-Cli . It is a simple app that fetches data from an Api and displays the result to the user. Upon completion of the project I decided to upload the project on Github but I realized my api key was not hidden. I work as a Laravel Back-end developer so I already knew I needed something like a “.env” file to store api keys. I came across a package called <a href="https://www.npmjs.com/package/dotenv">dotenv</a> and here is how it works:</p><p>Go to your terminal and install <a href="https://github.com/motdotla/dotenv">dotenv</a> with either npm or yarn</p><pre># Using npm:<br>npm install dotenv<br><br># Using yarn:<br>yarn add dotenv</pre><p>Add the line below as early as possible in your application. We are using Vue-cli so that file will be your main.js</p><pre>require(&#39;dotenv&#39;).config();</pre><p>You now have access to your environment variables in your app</p><p>Create a .env file in the root of your application and store your variables</p><p>According to vue-cli official documentation only variables that start with VUE_APP will be statically embedded into the client bundle with webpack.DefinePlugin.</p><p>For example your .env should look like this</p><pre>VUE_APP_SECRET=secret</pre><p>You can check if everything worked fine by typing in your main.js</p><pre>console.log(process.env);</pre><p>Restart your server after making changes, you should see something like this</p><pre>{<br> NODE_ENV: &quot;development&quot;,<br> VUE_APP_SECRET: &quot;secret&quot;,<br> BASE_URL: “/”<br>}</pre><p>You can access your env variable in your application code: process.env.VUE_APP_SECRET</p><p>That’s all you are done!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=699f7a93f11c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>