630

June 21st, 2023 × #Conferences#APIs#Troubleshooting

Potluck × Warp × Skeleton UI × Edge Functions × Donut Scoping

Wes and Scott discuss upcoming conferences, computer issues, and strategies for working with rate limited APIs.

or
Topic 0 00:11

Potluck of questions

Wes Bos

Welcome to Syntax, the podcast with the tastiest web development treats out there. We've got a potluck for you today. Some really good questions on rate limiting.

Topic 1 00:20

Rate limiting, enums, authentication

Wes Bos

Are you using TypeScript's enums or rid. What's with the enam hate as of late? API authentication domains.

Wes Bos

Why would I even need to use something like a ready. Edge function or can I just keep going with my edgeless functions? We've got really good ones for you today. With me as always is mister Talinsky. How you doing today, Scott? Hey.

Topic 2 00:29

Edge functions

Guest 2

It's one of those days. I don't know what's going on, man.

Guest 2

Things things started out well enough, but, yeah, today has been a a straight up mess. Like, just getting my my computer is not recognizing any of my audio inputs, You know, and it's like I I did tear out my entire audio setup. Yes. But I did spend a significant amount of time dialing it in and testing it and making sure everything worked. And then I I pull up today in, you know, system preferences that normally shows all of the inputs.

Guest 2

It said no audio inputs available. And like, what do you mean there's no audio? There's an onboard microphone. There is, virtual inputs. It said nothing. So That's odd. Yeah. That's where we're at today. Yeah. It's like one of those things, like, rid Every single little bit of software that I was trying this morning since I've been in my office has been failing in some way. Like, Notion was not letting me do headings. Rid Like, I would do the hashes or the pound signs, and it would just write pound signs instead of making a heading. And no matter what I could do, I could not get it to do a heading. And that's like, Man, that's par for the course. I'm I'm ready to to be that gift of the guy tossing over his desk here. I'm I'm ready to to talk about tech, but I'm mad at my tech right now.

Topic 3 01:56

JS Nation conference

Wes Bos

Oh, awesome. I just got back from a conference rid. JS Nation, which was out in Amsterdam, and it was my first other than Reactathon twice In San Francisco, this is my 1st like big conference overseas, and it was really nice to sort of get back into it. And you mean since since COVID, right? Ready. Yeah, yeah, since COVID, so it's been pretty stoked about that. And like the the invites for the conference are starting to roll in. It seems like a lot of people are like back. And man, it's so refreshing to go to a conference again. Like, I feel like so good about seeing everybody and chatting and rid. Talking is great. You went to a conference as well. Right?

Topic 4 02:38

Render Atlanta conference

Guest 2

Yeah. I was at render, Atlanta. I've been told I was told while at render Atlanta that it's not rid. Actually, render ATL. It's render Atlanta.

Wes Bos

Oh.

Guest 2

Yeah. That's news to me. I thought I was just calling it render ATLs. I was part of the problem. But, rid Render Atlanta.

Guest 2

What an awesome conference.

Guest 2

What a great time.

Guest 2

Just hung out with the coolest people, you know, met met so many people from Twitter that you rid Never met in real life or whatever. Yeah. I talked about CSS. And I gotta say, I was on the the big stage, and I haven't given a talk that rid Big in front I mean, we did together on stage at Reactathon, what, last year? Yeah. And, I haven't been up there solo giving just a straight up solo talk since pre COVID myself, and it felt great. I felt, I felt very confident. I knew what I was talking about. I was really into the subject matter and whatever. Everything was great. Even though I had Everybody had technical difficulties. There were some craziness with the audio setups there, but you know what? I just rolled with it and, rid Had a had a really good time. So, yeah, I I'm I'm right there with you. What an awesome, just, total vibe, Refresher. I got to hang out with some, you know, wonderful folks from Mux and, some of our our good friends from all over the planet. So it was just really cool. Wicked. Wicked. Ready. Yeah. All right. Well, maybe we should do

Wes Bos

another episode on on conferences on, like, how to get the most out of them and Maybe even getting into speaking because that's questions we have as well. But let's get into the questions we have for the podcast here. The first one we have ready. Is how do you it's from Alex Webster. How do you handle consuming rate limited API, specifically when when you want to retrieve all products rid. From a paginated API endpoint. My current approach involves a while loop with a map loops and time out, which looks messy and triggers ESLint warnings.

Topic 5 04:33

Exceeding rate limits

Wes Bos

Rid. Is there a more efficient way to fetch all records without exceeding a rate limit? Yeah, this is really tricky because a lot of times You are hitting APIs and those APIs will have a number of times that you can submit it. Specifically, I've been working with the OpenAPI ready. Open AI API. Again, that's like the hardest thing in the world to say.

Wes Bos

That has two limits on it. How many requests per rid. 60 seconds you can do as well as like how many tokens you can send it per hour. And the kind of frustrating thing about it is that they give you your rate limit API data via headers on a response, meaning that when you get a response back, they'll also give you a little bit of data in the headers that will say, hey, this is kind of where you're at with how much space you have available to yourself.

Topic 6 04:55

OpenAI API rate limits

Wes Bos

Rid. The other way you can sort of do that is just try the request.

Wes Bos

And if they refuse it, then you have to retry it. So ready. How do you approach these types of things?

Share

Play / pause the audio
Minimize / expand the player
Mute / unmute the audio
Seek backward 30 seconds
Seek forward 30 seconds
Increase playback rate
Decrease playback rate
Show / hide this window