Angular T-Shirt Giveaway Winner!
5:31
Let's TDD An Exercise Tracker [ep02]
39:08
100 Days Of Code: 9 Day Review
27:22
2 жыл бұрын
How To Hide API Keys Using Netlify
56:55
How To Deploy Codepen Apps To Netlify
10:49
Пікірлер
@redlense4
@redlense4 3 ай бұрын
Well taught mate. Thanks 😀
@Tarabass
@Tarabass 4 ай бұрын
For me installing the prettier formatter extension into vscode and set it as the default formatter did the trick :)
@SidharthSreekumar
@SidharthSreekumar 4 ай бұрын
Thanks for making this video. I was having trouble finding a solution to manage secrets and now I know.
@DanFletcher90
@DanFletcher90 4 ай бұрын
Glad I could help!
@deanelie7775
@deanelie7775 11 ай бұрын
Thank you so much I was so frustrated with securing my Contentful API Keys (even if they are only read-only), this helps a lot!
@DanFletcher90
@DanFletcher90 11 ай бұрын
Glad this was helpful!
@beloaded3736
@beloaded3736 Жыл бұрын
Dan you are awesome thanks
@DanFletcher90
@DanFletcher90 11 ай бұрын
Thank you!
@Alan-fu2vx
@Alan-fu2vx Жыл бұрын
This helped me big time when figuring out how to hide secrets like API keys or tokens without needing to host a backend proxy server. Since we'd be deploying to a BaaS anyway the use of serverless functions is of great help when dealing with 3rd party API calls and such. Thanks!
@DanFletcher90
@DanFletcher90 Жыл бұрын
Glad this helped! Thanks for the comment 😊
@swannjulien
@swannjulien Жыл бұрын
Thank you so much, your video helped me a lot
@DanFletcher90
@DanFletcher90 Жыл бұрын
Glad it helped!
@1uckyswish107
@1uckyswish107 Жыл бұрын
I love your VS code Theme.. what is the name please ;)
@DanFletcher90
@DanFletcher90 Жыл бұрын
Thanks! It's Monokai Pro with the "Machine" theme set. Font is Cascadia Code with ligatures turned on :)
@Elias-xp3bs
@Elias-xp3bs Жыл бұрын
This was super helpful! Got my first netlify function to work 🥳
@DanFletcher90
@DanFletcher90 Жыл бұрын
Awesome 🙌 glad this helped!!
@T12321
@T12321 Жыл бұрын
Thank you Dan 👍
@DanFletcher90
@DanFletcher90 Жыл бұрын
You're welcome!
@adhirajagarwal9640
@adhirajagarwal9640 Жыл бұрын
I had been stuck at this for some days now, you are a lifesaver buddy, I also checked out some of your other videos and I have to say, they are great
@DanFletcher90
@DanFletcher90 Жыл бұрын
Hey glad this helped 😊 Thanks for the kind words!
@jurgenlandrie1380
@jurgenlandrie1380 Жыл бұрын
So, since VueJS changed a lot in terms of scaffolding a project, I was wondering if there's any up to date version on how to get this working perfectly. As package.json looks a lot different with vue-cli being deprecated. Thanks!
@DanFletcher90
@DanFletcher90 Жыл бұрын
An update to this tutorial based on Vue3 is in my backlog! It will likely be released as an update to the original blog post first, or a new one if I feel it's necessary
@jurgenlandrie1380
@jurgenlandrie1380 Жыл бұрын
@@DanFletcher90 Awesome... can't wait :-)
@maplestoryinchinese
@maplestoryinchinese Жыл бұрын
I'm coming across a problem where If I try to do a batch of API calls it returns a 500 error. Probably due to rate limiting, any workaround for this? On the Frontend I'm able to do this easily with no issue but my API key would be at risk. Also it seems like doing the fetching using Netlify Functions slows down the runtime for the Frontend.
@DanFletcher90
@DanFletcher90 Жыл бұрын
Is the 500 coming from Netlify or from the service that you're connecting too? I'm not aware of any rate limiting on the Netlify side. The performance issue can definitely be a concern in some cases. My video doesn't get into the nuance here, but as long as your key only has read-access, it's technically safe in your front-end application Many 3rd party API's will offer SDK's specifically for client-side code, so one option is to just go with that approach. If you still need to make calls to a service that require keys that have to be protected, then a Netlify function (or any serverless function) will typically perform better at scale than a traditional backend. But another option for certain use-cases is to look at "Edge Functions" which execute on a server closer to where the user physically is Hopefully that's helpful, if not let me know!
@thineshkumar1389
@thineshkumar1389 Жыл бұрын
You explained things very well and I'm glad you kept the part on troubleshooting bugs or error that you encountered. It really gave me an exposure.
@DanFletcher90
@DanFletcher90 Жыл бұрын
I appreciate the feedback! Thanks!
@Tynchotyn
@Tynchotyn Жыл бұрын
Spectacular video Dan, really helpful. Thanks a lot!
@DanFletcher90
@DanFletcher90 Жыл бұрын
Thank you!!!
@fraternidadeaustriaca2625
@fraternidadeaustriaca2625 Жыл бұрын
extremely long winded, this video could easily be 10 minutes long
@DanFletcher90
@DanFletcher90 Жыл бұрын
Appreciate the feedback 🙏
@phillbaska
@phillbaska Жыл бұрын
I'd like to ask a question.. is my assumption correct that netlify serverless function's are not suitable for web apps with large volumes of traffic? i can see the limit of serverless functions is 125k per site for netlify. I presume that means if 125k people visited the weather example site, this would mean 125k serverless functions to gather the data and a charge would be incurred for surpassing the limit?
@DanFletcher90
@DanFletcher90 Жыл бұрын
Looks like their pricing page has changed since I last looked. I guess it would depend on what they mean by "$25+" How many more requests do you get for that? I'm not sure. But in termyof being able to handle high volume traffic, that's kind of the point of going serverless If you're handling millions of requests per month it would depend on what Netlify charges, but it could make sense to just switch to native AWS functions at that point High volume is relative too I always like to think in terms of revenue per request A blog typically has low revenue per request because the money comes from ads which only ads up to anything significant at extremely high volumes But an app that users pay a subscription for and generates a high MRR with a low user count might not ever need 125k reqs/month in order to make decent money
@phillbaska
@phillbaska Жыл бұрын
@@DanFletcher90 thanks for the detailed and speedy reply. Yes i thought they would be a little bit more transparent with the numbers, but it looks like enterprise is unlimited (fair usage). I guess you could assume that if such a volume of calls were actually be being made in something like a customer portal (rather than a blog) to gather prior purchase info etc, then as long as they are an active customer it would somewhat pay for itself. I'll take a look into AWS functions, then check if you have a video on it when i fail to understand it🙂
@DanFletcher90
@DanFletcher90 Жыл бұрын
@@phillbaska hey no worries! YT failed to show me this notification though so sorry for the late reply lol!
@phillbaska
@phillbaska Жыл бұрын
Great video, thank you. It was quite refreshing to see a content creator make little mistakes along the way and not editing it out, i actually learnt a little more this way.
@DanFletcher90
@DanFletcher90 Жыл бұрын
Oh that's amazing! Appreciate hearing that feedback :)
@danielishida5001
@danielishida5001 Жыл бұрын
such an underrated video! Half way in the video and i already leraned so much. Great stuff!
@DanFletcher90
@DanFletcher90 Жыл бұрын
Thanks you so much! 🙏
@maplestoryinchinese
@maplestoryinchinese Жыл бұрын
Hey Dan, after some tinkering around and praying everything goes smoothly with my React Application it works! Thank you so much kind sir, we need more people like you! Sending you much love.❤❤❤❤❤❤❤
@DanFletcher90
@DanFletcher90 Жыл бұрын
Awesome!! 🙌 Glad you got it working!
@maplestoryinchinese
@maplestoryinchinese Жыл бұрын
For some weird reason using Fetch will not work for this project and cause an error but switching over the Axios seems to fix the issue. I don't know why. Aren't they basically the same thing just with Axios making it more simplified process?
@DanFletcher90
@DanFletcher90 Жыл бұрын
Hi! It depends which side of the app you're using `fetch`. If you're using it inside of the serverless function you won't have the `fetch` API available to you (yet). If it's on the browser side, you should be able to use fetch Happy to take a look for you if you have a GitHub repo to share!
@daniyarcrow293
@daniyarcrow293 Жыл бұрын
you talk too much
@DanFletcher90
@DanFletcher90 Жыл бұрын
I also repeat replies
@daniyarcrow293
@daniyarcrow293 Жыл бұрын
you talk too much
@DanFletcher90
@DanFletcher90 Жыл бұрын
I also repeat replies
@mogusmogus
@mogusmogus Жыл бұрын
Thank you so much Dan! I am really grateful for this amazing tutorial.
@DanFletcher90
@DanFletcher90 Жыл бұрын
Glad this was helpful!!
@iurisinc8691
@iurisinc8691 Жыл бұрын
Okay, I won't be able to copy/paste your API key and abuse it but this is in case I just want to abuse your API key and nothing else. I believe many of the "attacks" are related to simply stealing data. So, in your case, I will not be making calls directly to the weather API using that secret API key that you hide in a environment variable but I will STILL be ABLE to indirectly get the data from that API by navigating to that specific URL on your public website. Isn't that right? I believe that hiding your API key without implementing some kind of Authentication to your website is just a problem half solved. In addition to that it is good to add some kind of HTTP 429 restrictions.
@DanFletcher90
@DanFletcher90 Жыл бұрын
Yeah you're absolutely right! Unfortunately as happy as I am with the overall quality of this video, it was a big learning experience for me. Not enough planning upfront, and not understanding how to pace it properly, lead me to turning what I thought would be a 20 minute video into something that was almost an hour and is missing a lot of details like what you just mentioned. But yeah you're right, a better example of this would be protecting your secrets for API's that are accessed from behind an authed user, and you could use Netlify Auth for that, which works with or without Netlify Functions Appreciate the comment!
@kells8241
@kells8241 Жыл бұрын
This has been so so helpful, I hope you make more of these. I finally felt like I could actually understand it when it was read aloud, thank you 🫶🏽
@DanFletcher90
@DanFletcher90 Жыл бұрын
Glad this was helpful! I hope to pick this series up again in the future. Comments like these are really encouraging!
@Piccolo230
@Piccolo230 Жыл бұрын
Thank you, really appreciate a long and in depth video about this topic. Its often overlooked
@DanFletcher90
@DanFletcher90 Жыл бұрын
Hey glad you found this helpful! Appreciate the comment 🤙
@serenasmith2746
@serenasmith2746 Жыл бұрын
In 37:40 how did you get the multi-cursor function?
@DanFletcher90
@DanFletcher90 Жыл бұрын
Oh good question! Not sure why I didn't say what I was pressing in the video lol. On Windows it's alt+click to create the mult-cursors like that. ctrl+alt+up will create a mult-cursor above your current cursor and... ctrl+alt+down will do the same but below your cursor Looks like someone made a post in the forums with a ton more shortcuts too: discuss.codecademy.com/t/keyboard-shortcuts-for-codecademy-excercises/440723
@blarvinius
@blarvinius Жыл бұрын
So good! I really appreciate the nice slow pacing and detailed over-explaining!
@DanFletcher90
@DanFletcher90 Жыл бұрын
Thank you!
@marie-elizeventer7080
@marie-elizeventer7080 Жыл бұрын
Question please: I have a project, that has access to a database. The Client ID, Client Secret and Refresh Token are used to generate an ACCESS CODE, which is only valid for 60 minutes, upon which a NEW Access Token has to be generated. The ClientID, -secret and Refresh token I am hiding in Netlify's variables, and I access them through a serverless functions. My question is: Where do I put the Access Token so that it is NOT accessible/visible in the front end for the hour that it is valid?
@DanFletcher90
@DanFletcher90 Жыл бұрын
Hmm I'm not sure if I can answer that question very well as a KZfaq comment but there is a great article by Auth0 that I think you'll find useful: auth0.com/docs/secure/security-guidance/data-security/token-storage Let me know if that helps!
@marie-elizeventer7080
@marie-elizeventer7080 Жыл бұрын
Dan! This was GREAT! Thanks! You made it SOOOO clear to understand. I am a total newbie, but following this tutorial was an eye opener. I really needed it!
@DanFletcher90
@DanFletcher90 Жыл бұрын
Hey thanks so much for the kind words! Glad this was helpful!
@ecdu-eu
@ecdu-eu Жыл бұрын
Dear Dan, I hope you are well. Thanks for the video. It helped me a lot. Dan, maybe I can ask you something, please. I'm going insane here and I hope you can answer: As in your example, I have the /functions folder above the /src folder. Structure: /main/functions/fetch-api.js (in my case) /main/src/index.html, netlify.toml and so on. Unfortunately, my project only works if I also place the Functions folder under the "/src" path. So I have to put the "/function" folder in "/src/function" because after netlify build and netlify deploy only /src can be accessed from external. I got myself extra netlify (didn't know that before) because I thought that with netlify and axion in combination, everything works like a kind of proxy that hides the request to the server with the API. In this case, however, I can call /functions/whatever.js and the script is displayed in the browser. My goal is that the API key can no longer be found at all. I use some Amazon AWS keys and want to hide them with API_SECRET_n1-nx like in your example. Do you maybe have an idea what I could possibly do? I've been desperate here for days. I would be happy about an answer, greetings into your home country. Thanks in advance and best regards, Stefan
@DanFletcher90
@DanFletcher90 Жыл бұрын
Hey Stefan, thanks for the kind words! So your Netlify functions should definitely not be in your `src` folder. The fact that you have to put them there in order for the functions to work tells me your toml file is likely to blame. Your `netlify.toml` file should look like this if your following along with the tutorial: ``` [build] functions = "functions" publish = "src" ``` (github.com/DanJFletcher/how-to-hide-api-keys-with-netlify-functions/blob/master/netlify.toml) If you're struggling to get them to work in a custom project you may have to read through the documentation for Netlify toml files and see if there are any configurations that make sense with your project. docs.netlify.com/configure-builds/file-based-configuration/ Hope that helps! Let me know if you still need help )
@ManeeshShaji
@ManeeshShaji 2 жыл бұрын
But if your netlify functions doesn’t have any authentication then anyone can call your functions in a loop to hit the limit right? You can setup rate limiting for the functions, but even still with patience they can slowly hit the api key limit right?
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Ah haha yup! I didn't catch that mistake until a while after I uploaded this. You're the first person to call me out on it 🎊 Yeah technically it's a bit more complicated than just putting it behind a function if the route is public anyway. If it's behind authentication which you can do with Netlify as well, you're fine But by hiding your keys behind the function at least they can't get stolen, and you can rate limit as you said, to lessen the impact, set a hard limit to avoid being overbilled, or even use a leaky bucket algorithm on your throttle with a ratio that makes it impossible to abuse the route in a meaningful way Thank you for your comment 🙏
@nessbokobza9745
@nessbokobza9745 2 жыл бұрын
Hey Dan, which theme are you using in VsCode?
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Hey there Ness! I'm using Mokai Pro with the Machine filter on
@nessbokobza9745
@nessbokobza9745 2 жыл бұрын
@@DanFletcher90 Tnx!
@DanFletcher90
@DanFletcher90 2 жыл бұрын
@@nessbokobza9745 No problem!
@badguardian
@badguardian 2 жыл бұрын
What is your icon theme? pls, its dope
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Hey thanks, I love them too! Monakai Pro is the theme I use which includes the dope icon set 🤙
@badguardian
@badguardian 2 жыл бұрын
@@DanFletcher90 Nice, I recently added a smooth 4px expanding cursor style, change cursor color, added Fira Code iScript font for cursive words and now it all looks completely dope:)
@esra6450
@esra6450 2 жыл бұрын
These series are super helpful !! Thank you
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Hey glad this is helpful!
@ivanc.6064
@ivanc.6064 2 жыл бұрын
4:42 package . jason 9:26 vetur 18:04 package . jason (cont.)
@victoroluwayemi9531
@victoroluwayemi9531 2 жыл бұрын
Finally!!💃💃 Thanks for the video
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Glad you liked the video! 😊
@Tassaczek
@Tassaczek 2 жыл бұрын
Why tabs are nonsense? People use it because you can set width of tabs in your code editor.
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Haha it was only a joke ;) I don't really care if people use spaces or tabs. The IDE takes care of the nuance anyway. But to clarify; when people say "spaces" they still press the "tab" key on their keyboard to make indentation. It's just that the IDE has been configured to convert tabs into a number of spaces which is configurable. For example on the majority of the code bases I work in I press the tab key and my editor inserts either 2 or 4 spaces. I almost never see modern PHP, JavaScript or TypeScript codebases use tab as the indent character. Thanks for leaving a comment! 🙏
@jochenstierberger383
@jochenstierberger383 2 жыл бұрын
Would this also work if my API key has to be inside a header?
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Yes absolutely! From the Netlify function you can authenticate with the API however the API needs you to
@BlockCylinder
@BlockCylinder 2 жыл бұрын
@Dan Fletcher This video was great. It really helped me get my app working the way I want it to. I'm just masking the my API key for a free weather API but the exercise can be applied to more sensitive information in the future. One question - This video is just a bit over a year old, and I'm wondering if you would still use Axios if you were making it today. I've been told that Axios is out of style, and Fetch is the move. I only started studying JS one year ago myself, so I'm just trying to get a handle on what's the best method today. Thank you!
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Hey glad you found this helpful! Both adios and fetch are totally fine to use. I use both frequently. I do tend to use fetch more in small projects and then only worry about bringing axios in when I want some of its features As a beginner it truly doesn't matter which one you pick. Axios is a little simpler to use in my opinion but it really doesn't matter There's a really good article that breaks down the differences too which might help you understand more: blog.logrocket.com/axios-vs-fetch-best-http-requests Cheers!
@anokimusic
@anokimusic 2 жыл бұрын
thanks man!
@DanFletcher90
@DanFletcher90 2 жыл бұрын
No problem!
@bronsonspies1508
@bronsonspies1508 2 жыл бұрын
Is it possible to do this with an app that is deployed on tomcat? It looked like you were going to maybe show a way with the concurrently dependency… also thanks for this concise video
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Hey no problem! I actually don't know what tomcat is 😅 do you have a link?
@bronsonspies1508
@bronsonspies1508 2 жыл бұрын
@@DanFletcher90 just a http web server! I need to hide some api keys in an angular app but I don’t have the option of deploying it to netlify, I realize I could just build my own middle ware but I’d rather not 😅
@DanFletcher90
@DanFletcher90 2 жыл бұрын
@@bronsonspies1508 Oh ok do you mean Apache Tomcat? No way to use Netlify functions without deploying to Netlify, but you could use AWS Lambda which Netlify Functions are actually using under the hood I haven't tried it but I've heard AWS has a tool for testing lambdas locally too! It'll be a little more level but it's definitely away to accomplish something similar while not building a full on backend API The other option of course is throw up a simple Node API somewhere to hide your keys behind and the Angular app can proxy through that Hope that's helpful!
@wajry
@wajry 2 жыл бұрын
This was exactly what I was looking for. Such a good explanation! Only thing I would ask for is to set your VS code and browser to full screen, the code was a little bit hard to see on my small laptop. Thanks for the lesson man!
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Hey thanks for the feedback! Yeah definitely agree the font needs to be larger in this video :)
@wajry
@wajry 2 жыл бұрын
@@DanFletcher90 I just got back to this after a while, and tried to set a up a netlify function WITHOUT Axios. Couln't make it work until I found out that Node.Js doesn't know what fetch() is. Is that why you used Axios?
@DanFletcher90
@DanFletcher90 2 жыл бұрын
@@wajry Hey! Yeah no fetch API at the time I recorded this. Node has an https module used for making requests. But yeah, axios is just a bit easier to work with and what most people are familiar with. There's a good article on making requests with Node here: nodejs.dev/learn/making-http-requests-with-nodejs If you use Node 18 it actually has fetch now!
@codenerd7823
@codenerd7823 2 жыл бұрын
Good video keep it up
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Thank you!
@codenerd7823
@codenerd7823 2 жыл бұрын
2:45 it's not true on my machine it's passing all test cases but on internet version it shows error
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Oh yeah no it doesn't always work that way for me!
@tommybernaciak7457
@tommybernaciak7457 2 жыл бұрын
Great video!
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Thank you!
@martinluna7963
@martinluna7963 2 жыл бұрын
Great video, helped me a lot too! I'm doing something similar with an exchange rates API. I need to update the response with a historical rates endpoint, how can I update the endpoint where you using "current'? Do I need to use queryStringParameters or something else? About the video I found that sometimes the font size was a little too small for me, maybe try to increase it in the future.
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Hey thanks for the feedback! Yeah I agree the font is a little small in parts. I've actually started recording my screen at 175% scale in all my future videos which makes a big difference :) As for your question: "current" in the case of Weather Stack's API is actually not a query parameter it's just a part of the URI I'm sending a request to. But I'm not sure if I understand what you're trying to do. Are you able to send me a link to the API you're working with? Feel free to DM me on twitter too :) @danfletcherdev is my handle there
@mysolo17
@mysolo17 2 жыл бұрын
great video. thank you for your sharing
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Glad it was helpful!
@kuldeepbhatt8475
@kuldeepbhatt8475 2 жыл бұрын
I'll bump this video by leaving the comment here. Best wishes and HNY.
@DanFletcher90
@DanFletcher90 2 жыл бұрын
Thanks so much! And same to you too