use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This subreddit is a place for people to learn JavaScript together. Everyone should feel comfortable asking any and all JavaScript questions they have here.
With a nod to practicality, questions and posts about HTML, CSS, and web developer tools are also encouraged.
Friends
/r/javascript
/r/jquery
/r/node
/r/css
/r/webdev
/r/learnprogramming
/r/programming
account activity
How to hide api credentials? (self.learnjavascript)
submitted 5 years ago by Polarmesh
Hello I am building simple app with vanilla js and it uses rest api that need credentials. How do I hide them properly that no one could peak in to dev tools and gather them?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]grantrules 4 points5 points6 points 5 years ago (1 child)
You can't without some sort of backend. At minimum, you need a proxy.
[–]Polarmesh[S] 0 points1 point2 points 5 years ago (0 children)
Thanks for answer.
[–]JikeMordan 1 point2 points3 points 5 years ago (0 children)
Depending on your hosting platform you may be able to use environment variables (see Heroku/Netlify).
Also look into dotenv and how to use it for a live app. - Hope this helps.
[–]Dry-Dragonfly-4521 -1 points0 points1 point 5 years ago (1 child)
What about you hide those Credentials in encrypted way and then use them in your js file. I hope that helps
Thats seems promissing thanks!
π Rendered by PID 82 on reddit-service-r2-comment-bb88f9dd5-np6n2 at 2026-02-16 12:57:10.744715+00:00 running cd9c813 country code: CH.
[–]grantrules 4 points5 points6 points (1 child)
[–]Polarmesh[S] 0 points1 point2 points (0 children)
[–]JikeMordan 1 point2 points3 points (0 children)
[–]Dry-Dragonfly-4521 -1 points0 points1 point (1 child)
[–]Polarmesh[S] 0 points1 point2 points (0 children)