After the recent Axios issue we faced in our project, I’ve been asking myself: Should we keep using Axios, or is it finally time to migrate to modern alternatives? Axios has been a reliable workhorse for years — great interceptors, cancel tokens, and wide compatibility. But every dependency adds risk, and the JS ecosystem has evolved. Here’s a quick, practical comparison of the strongest alternatives: Fetch API → Native in browsers and Node.js (v18+). Zero dependencies, full control, but you handle JSON, errors, and retries manually. Ky → My current favorite. Tiny (~2KB), elegant wrapper around Fetch. Built-in retries, timeouts, hooks, and a super clean API. Perfect developer experience with almost no boilerplate. Undici → The high-performance HTTP/1.1 & HTTP/2 client that actually powers Node.js native Fetch. Blazing fast on the server side. Migration isn’t always trivial (especially if you heavily rely on interceptors), but the payoff in bundle size, security, and long-term maintainability is real. Have you already made the switch in your projects? Or are you staying with Axios? Would love to hear real-world experiences and lessons learned 👇 #JavaScript #NodeJS #WebDevelopment #Frontend #Backend #Axios #Fetch #Ky #Undici
Should We Ditch Axios for Fetch or Ky?
More Relevant Posts
-
I replaced 4 axios packages with 1. axios alone doesn't handle: → caching → retry with backoff → request deduplication → concurrency limiting → streaming → upload progress → metrics So I built 𝐧𝐞𝐱𝐮𝐬-𝐡𝐭𝐭𝐩 — a lightweight HTTP client that does all of it out of the box. ✅ Zero dependencies ✅ Tiny bundle (~3kb) ✅ TypeScript-friendly ✅ Built for modern web + Node.js apps ✅ Cleaner API, fewer packages, less maintenance I also built a full interactive testbench app to showcase every feature live — real requests, real behavior, real performance. You can see it in the video 👇 I also published a blog on 𝐌𝐞𝐝𝐢𝐮𝐦 explaining why I built it and how it improves on axios. No more stitching together multiple libraries just to make requests work properly. One package. Everything included. 📦 npm: https://lnkd.in/gHdGaZ-G ⭐ GitHub: https://lnkd.in/g7Qeyz99 📝 Medium: https://lnkd.in/gr5etBeU Install: 𝐧𝐩𝐦 𝐢𝐧𝐬𝐭𝐚𝐥𝐥 𝐧𝐞𝐱𝐮𝐬-𝐡𝐭𝐭𝐩 #javascript #typescript #webdev #nodejs #opensource #frontend #backend #programming #developer #coding
To view or add a comment, sign in
-
Spring Boot 3.x + Virtual Threads = game changer. Tested a sample app and saw 60% latency improvement in high-concurrency scenarios. Worth exploring for your backend...
To view or add a comment, sign in
-
Sat down nervous. 4-5 hours later, didn't notice the time go. That's Day 17. Frontend setup always looked like a lot. Interceptors, token storage, socket lifecycle, navigation switching. Today I just sat down and built it. The thing that clicked hardest — Axios interceptors. 🔄 I've always used axios directly. Copy the header, paste the URL, repeat. Today I learned why that's wrong. One axios.create() — every API call goes through it. Token attached automatically. 401 comes back? Silent refresh, silent retry. User sees nothing. Also learned hooks don't work outside React components the hard way. Interceptor needs Redux state — can't useSelector there. Import the store directly, call getState(). Simple once you know it. Confused at parts. Amazed by the end. 🔒 If you've built auth flows like this and have pointers — drop them below. Day 17/30 #buildinpublic #reactnative #javascript #softwaredevelopment
To view or add a comment, sign in
-
I spent an hour debugging a file upload issue. Controller — fine. DTOs — fine. S3 logic — working absolutely fine. Everything looked perfect. But there was one problem: There were zero logs. That silence told me something important: 👉 The request never reached my app. Swipe to see how a single config line was silently rejecting every upload 👇 #backend #nginx #debugging #nodejs #nestjs #softwaredevelopment #buildinpublic
To view or add a comment, sign in
-
𝗘𝘃𝗲𝗿𝘆 𝗔𝗻𝗴𝘂𝗹𝗮𝗿 𝗮𝗽𝗽 𝗺𝗮𝗸𝗲𝘀 𝗔𝗣𝗜 𝗰𝗮𝗹𝗹𝘀. But very few developers fully use the power behind them. Because most people focus on: 👉 Services 👉 HTTP calls 👉 Handling responses And completely ignore one of the most powerful features: 𝗔𝗻𝗴𝘂𝗹𝗮𝗿 𝗜𝗻𝘁𝗲𝗿𝗰𝗲𝗽𝘁𝗼𝗿𝘀. At first, you might not need them. But as your app grows… You start repeating the same logic everywhere: • Adding auth tokens • Handling errors • Logging requests • Modifying headers And your code becomes messy. That’s where interceptors come in. They sit between your app and every HTTP request. And give you a central place to: ✓ Attach authentication tokens ✓ Handle global error responses ✓ Log and debug API calls ✓ Transform requests and responses All without changing your services. That’s the real power. But here’s where many developers go wrong: • Putting too much logic inside interceptors • Creating tightly coupled logic • Not handling errors properly The right approach is: 👉 Keep interceptors focused and modular 👉 Use them for cross-cutting concerns 👉 Avoid mixing business logic Because interceptors are not just a feature. They’re an 𝗮𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲 𝘁𝗼𝗼𝗹. I wrote a detailed breakdown explaining 𝗵𝗼𝘄 𝗔𝗻𝗴𝘂𝗹𝗮𝗿 𝗶𝗻𝘁𝗲𝗿𝗰𝗲𝗽𝘁𝗼𝗿𝘀 𝘄𝗼𝗿𝗸 𝗮𝗻𝗱 𝗵𝗼𝘄 𝘁𝗼 𝘂𝘀𝗲 𝘁𝗵𝗲𝗺 𝗽𝗿𝗼𝗽𝗲𝗿𝗹𝘆. 𝗥𝗲𝗮𝗱 𝘁𝗵𝗲 𝗳𝘂𝗹𝗹 𝗮𝗿𝘁𝗶𝗰𝗹𝗲 𝗵𝗲𝗿𝗲 👇 https://lnkd.in/dmtHUMfb Curious to hear from Angular developers: 𝗪𝗵𝗮𝘁’𝘀 𝘁𝗵𝗲 𝗺𝗼𝘀𝘁 𝘂𝘀𝗲𝗳𝘂𝗹 𝘁𝗵𝗶𝗻𝗴 𝘆𝗼𝘂’𝘃𝗲 𝗶𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁𝗲𝗱 𝘂𝘀𝗶𝗻𝗴 𝗶𝗻𝘁𝗲𝗿𝗰𝗲𝗽𝘁𝗼𝗿𝘀? #Angular #FrontendDevelopment #WebDevelopment #JavaScript #SoftwareEngineering #Programming #Coding
To view or add a comment, sign in
-
Fetch vs Axios in React — Which one do you prefer? 🤔 Both are used for API integration, but here’s the difference: Fetch: • Built-in browser API • Lightweight • Manual error handling Axios: • Auto JSON parsing • Interceptors support • Better error handling • Request cancellation For large-scale React apps, Axios provides more flexibility. But Fetch is great for smaller projects. Which one do you use in production? #reactjs #axios #fetchapi #frontenddeveloper #mernstack #javascript #reactdeveloper #webdev #coding #softwaredeveloper
To view or add a comment, sign in
-
🚫 Stop Using Fetch ❌ ✅ Learn Axios Properly (Instance + Interceptors) | React + Redux Toolkit If you're still using Fetch for API calls in React, it's time to level up 🚀 In this video, I’ve covered everything you need to master Axios—from basics to advanced concepts used in real-world applications and interviews. 🔍 What you’ll learn: ✔ Fetch vs Axios – which one to use and why ✔ JWT Authentication explained in simple terms ✔ Creating Axios Instance for clean & scalable code ✔ Request & Response Interceptors ✔ Real-world implementation with Redux Toolkit ⏱️ Chapters: 00:00 – Introduction 02:00 – Axios vs Fetch 10:40 – JWT Token Explained 11:36 – Axios Instance Implementation 35:40 – Axios Theory 38:02 – Interceptors Setup 💡 Perfect for React developers preparing for interviews or building production-level apps. 🎥 Watch here: https://lnkd.in/gGEipkci 💬 If you find this helpful, don’t forget to like, comment, and share. 🔔 Follow for more frontend & React content! #ReactJS #ReduxToolkit #Axios #WebDevelopment #FrontendDeveloper #JavaScript #InterviewPreparation #CodingTips
Stop Using Fetch ❌ Learn Axios Properly (Instance + Interceptors) | React + Redux Toolkit
https://www.youtube.com/
To view or add a comment, sign in
-
Axios just got compromised. If you don’t know what it is, Axios is what a lot of apps use to make API calls, front end, back end, everywhere. Axios has: 80-100M downloads every week That’s roughly 11-14M installs a day Around 130-160 installs every second. And that’s just direct installs, not counting how many projects pull it in indirectly. For a couple of hours, attackers got access to a maintainer account and pushed malicious versions to npm. So during that time, installs weren’t just installing a HTTP client, they were pulling in a hidden dependency that dropped a remote access trojan onto machines. If you do the maths, even a 2-3 hour window at that rate could mean hundreds of thousands of installs potentially exposed. That’s what makes this uncomfortable. You’re not installing some random package with 200 downloads. You’re installing something that sits in the core of the JavaScript ecosystem. If you think you might’ve installed it during that window: 1 - Remove the affected versions immediately 2 - Delete node_modules and lock files, then reinstall from clean sources 3 - Rotate any API keys, tokens, or credentials used on that machine 4 - Check for any unusual processes or outbound connections 5 - Treat the machine as potentially compromised, especially if it touched production systems Running “npm audit” regularly is one of those basic things that can help flag issues early. It’s not perfect, but it gives you at least some visibility instead of blindly trusting installs. If you’re leading engineers, this is even more confirmation that you should give them time to actually slow down and check things properly. Rushing is how this stuff slips through. If you’re a developer, you should already be pushing for that time. Security needs space, not just speed. You’re aim should always to be building quality apps. Heads up, Eyes open because with the way this quarters ended this won’t be the last one. #Technology #Axios #Jacascript
To view or add a comment, sign in
-
-
next-intl vs next-i18next: Choosing the Right i18n Library for Next.js Next.js developers choosing an i18n solution will likely narrow it down to two libraries: next-intl and next-i18next. Both support the App Router and Server Components. Both are actively maintained. But they take fundamentally different architectural approaches. This post compares them on the things that matter for a real project: how translations are loaded, how they integrate with your stack, and what workflows they enable. https://lnkd.in/e9i7BgVN
To view or add a comment, sign in
-
-
🧵 Day 12 of 40 — React System Design Series Most auth tutorials end at "store the JWT in localStorage." That's where the real implementation begins. Today I built a complete React auth flow — the production version: → authService — one place for all auth API calls → apiClient — axios interceptors for silent token refresh (transparent to the user) → useAuth hook — login/logout with loading and error state → LoginForm that stays clean (no token logic in the component) → credentials: 'include' — the silent bug most people miss The pattern where token expiry is invisible to users 👇 https://lnkd.in/ghMPhd7s #ReactJS #SystemDesign #Auth #Frontend #LearningInPublic
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development