1. License
“Permission is hereby granted, free of charge, to any person obtaining a copy”
Paid and closed-source products may use it; no fee and no on-screen credit needed.
github.com/nodejs/undici/blob/main/LICENSE3. Used by agents' projects
Dependency in 107 public GitHub projects set up for AI coding agents that we scanned (1.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error
What undici does
undici is the free JavaScript package that makes web requests from Node.js servers; Node's own fetch() runs on a copy of it. Installing it yourself gives your app the newest version plus extras such as proxies, retries, caching and fake answers for tests. It does not run in the browser.
What people build with it
Call outside services from your server
Your Node.js backend asks a weather, payment or AI service for data and reads the JSON answer, with less overhead than fetch().
Send every fetch through a company proxy
On a work network, one setting makes all fetch() calls follow the usual proxy settings, while local addresses skip the proxy.
Fake outside services in tests
Tests for code that calls other services get prepared answers instead of real network calls, so they run fast and offline.
Retry when a service hiccups
When another service answers 503 or 429 or drops the connection, the request waits and tries again a few times.
Cache answers that rarely change
Repeated requests for the same data are answered from memory while the other service says the data is still fresh.
A newer fetch than your Node.js has
Get request fixes and features before your Node.js version ships them, without upgrading Node.js itself.
undici popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How undici is used
- undici is a dependency in 107 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.2% of the 4,867 JavaScript/TypeScript ones), #9 of 126 in http clients and networking.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 363; those are left out of every share on this page.
- The most used alternative in our scan is Axios (470 projects).
- Projects that use it most often also use tsx (69.2%), Vitest (74.8%), Zod (80.4%).
- It is more common in projects set up for OpenClaw (11.7%) than for Cursor (0.9%).
By coding agent
Often used with
More about undici
Funding
- GitHub Sponsors: https://github.com/nodejs
- Open Collective: https://opencollective.com/nodejs
- 57 GitHub sponsors
Head to head
- Axios vs undici used together in 21 projects
More in HTTP clients and networking
Alternatives
undici This page
Pick Axios when the same request code must run in the browser and in Node.js and you want interceptors.
Pick Got when you want a Node.js request library with retries, hooks and streams in one friendly interface.
Pick httpx when your server is written in Python rather than Node.js.
Universal WHATWG Fetch API implementation for Node, browsers and React Native.
Get started
Tell your AI assistant
“Use the npm package undici (pin undici@8.12.4, Node.js 22.19+) for server-side requests; always consume or dump the response body, and use EnvHttpProxyAgent with setGlobalDispatcher if we are behind a proxy.”
Add undici to your Node.js project (version 8 needs Node.js 22.19 or newer).
npm i undiciMake a request and read the answer; always read or discard the body.
import { request } from 'undici' const { statusCode, body } = await request('https://api.example.com/data'); const data = await body.json();
Mistakes to avoid
Unread bodies keep connections busy; for request() reading the body is mandatory.
undici and Node's fetch route requests through dispatchers, not through an agent option.
The two copies are different implementations and can break when mixed.
A body can be consumed only once; the second call throws TypeError unusable.
undici 8 declares Node.js 22.19.0 as its minimum.
Questions
Do I need it if Node.js already has fetch()?
Not for simple requests. Install it when you need proxies, test mocks, retries, connection tuning or a newer version than your Node.js bundles.
Does setGlobalDispatcher also change Node's built-in fetch?
Yes. The global dispatcher is shared with the copy of undici inside Node.js.
Why do I get "TypeError unusable" after reading the body?
A body can be read only once; read it as text first if you need it twice, then parse the text.
Can it go through a SOCKS proxy?
Yes. ProxyAgent handles HTTP, HTTPS and SOCKS5 proxy addresses.
Can I use it in a paid product?
Yes. It is MIT licensed; keep the license notice with its files.