vercel/swr
React Hooks for Data Fetching observed · 2026-08-28
Health v2 · maintenance only
94/100
- Activity 99
- Release rhythm 85
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 37
- age_days: 2501
- days_rel: 21
- days_push: 10
- n_releases_24m: 14
Adoption not part of the score
32473 stars · 1382 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
SWR is a React Hooks library for data fetching, named after the stale-while-revalidate caching strategy. It returns cached data first, then revalidates in the background, providing built-in caching, request deduplication, revalidation on focus/reconnect, polling, pagination, optimistic UI, and React Suspense support.
Use cases
- fetch data in react components with a single hook
- cache and deduplicate api requests in a react app
- revalidate data when the window regains focus
- implement optimistic ui updates with local mutation
- add polling and real-time-ish data refresh to a dashboard
- share one request across many components
- handle pagination and scroll position recovery
- server-side render data fetching with nextjs
When to choose
- you're building a React or React Native app that consumes REST or any async data source
- you want lightweight data fetching with automatic caching and revalidation
- you use Next.js and want SSR/SSG-friendly client data fetching
- you prefer a minimal hook-based API over heavier query libraries
When to avoid
- your app doesn't use React (SWR hooks are React-specific)
- you need complex normalized caching or GraphQL fragments - consider Apollo or similar
- you need server-side state management rather than client data fetching
- you're on Vue, Svelte, or Angular - use TanStack Query or framework-native options instead
Facets
library · maturity stable
http-client caching state-management web-framework web-development frontend apis cross-platform react react-hooks data-fetching stale-while-revalidate suspense react-native nextjs typescript vercel swr nodejs web-server
10 sources
- readme: https://github.com/vercel/swr · fetched 2026-08-28 · a92586b36c6a
- homepage: https://swr.vercel.app · fetched 2026-08-29 · 0ac16643246d
- site_page: https://vercel.com/docs · fetched 2026-08-29 · 614e0cfe00de
- site_page: https://vercel.com/about · fetched 2026-08-29 · c78127d6b6a3
- site_page: https://vercel.com/docs/frameworks/full-stack/nuxt · fetched 2026-08-29 · 3e48525fbcdd
- site_page: https://vercel.com/docs/frameworks/full-stack/sveltekit · fetched 2026-08-29 · fec9e6e22eeb
- site_page: https://vercel.com/docs/frameworks/backend/nitro · fetched 2026-08-29 · f304c099ad65
- site_page: https://vercel.com/docs/frameworks/full-stack/tanstack-start · fetched 2026-08-29 · fb46d1029e2d
- site_page: https://vercel.com/changelog · fetched 2026-08-29 · 002ff21b7089
- site_page: https://vercel.com/pricing · fetched 2026-08-29 · 1621cac99317
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| vercel/swr | main | 94 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem