Hide an API Key | JavaScript Tutorial
HTML-код
- Опубликовано: 10 сен 2024
- 🎓 NEW: Earn a professional certificate in web development from Meta Inc. (course links in card below) 👇
⚡ Need hosting for a website, WordPress blog or Node.js app? We use HostWithLove: bit.ly/3V2RM9Q ❤️
This tutorial shows you how to hide an API key from users on the frontend and in your backend source code using environment variables.
#javascript #javascript_tutorial #nodejs #api #webdevelopment #frontend #tutorial
⚡Web development professional certificates from Meta Inc.⚡
Front-End Developer Professional Certificate: imp.i384100.ne...
Back-End Developer Professional Certificate: imp.i384100.ne...
iOS Developer Professional Certificate: imp.i384100.ne...
Meta Android Developer Professional Certificate: imp.i384100.ne...
Meta Database Engineer Professional Certificate: imp.i384100.ne...
why did you start with static files then move to a react app? can you do one for static files that dont run a server?
Bro what if i use API url from inspector panel (HTTP//LOCALHOST:3000/API) and call it from my web app i can get response of weather API without needing any KEY. 😵
I'm not a backend guy but i think you exposed entire weather API while securing your key. 🥲
Am i wrong ? 😅
how can i secure my firebase api key then ?
Thank you
You are welcome!
ty
sooo…you can’t really hide a key
As shown in the video, you can hide a key from users on the frontend, others when sharing your code and even from others with access to your source code on the backend with server-side environment variables.
No you cant, no matter how much you hide the key in front end, the user agent "browser" from client side still sends the key in get/req/body to api server. Which can be intercepted using tools like burp-suite. even if not visible in source as shown in this video.
@@MrYesnadir wait so how do u actually secure your api key ?
i think the best way is to encrypt using cipher