How do I get around this Issue

Hello guys!

I’d like to ask how do I hide my API keys before pushing my code to Github?

And I’ve tried DotENV to store my “API_KEY” but, with that I run into the “Uncaught Syntax Error: require not defined” . I tried Browserify to fix that, but then All my functions return “undefined” when I call “require” or “import” , Maybe I’m doing something wrong.

Can someone recommend someway I can do this? Or just maybe if you’ve ran into the same problem how did your resolve it? Or even better how did you do it, because I know most of you are familiar with APIs? thanks.

This might not be of much help since I can’t see what you are working on but you might want to look into your current code since dotenv usually is a basic file with constants assign to your API key. You also might want to look into the way you loading the dotenv file that cause the error you are describing

Is there a way I can maybe share the code with you and you have a look at it ?

I can’t guarantee you that I will be able to look at it in a timely manner but others might.
Usually sharing your GitHub repo with the general public (if possible) increase the chances of others seeing it and helping you out.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.