# Kong/swrv

Stale-while-revalidate data fetching for Vue

Repository: https://github.com/Kong/swrv
Canonical: https://ross.abutalabs.com/products/swrv
Homepage: https://docs-swrv.netlify.app
Language: TypeScript
License: Apache-2.0
License Family: permissive
Topics: vue, swr
Last push: 2026-08-04T18:18:30+00:00

## Health v2 (maintenance only)
Score: 79/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 44, longevity 100
- inputs: {"age_days": 2412, "days_push": 29, "days_rel": 163, "gap_med": 425, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2277, forks 75 (observed 2026-08-28T04:06:33.529994+00:00)

## What it is
swrv is a Vue Composition API library for remote data fetching using the stale-while-revalidate caching strategy. It serves cached data immediately, revalidates in the background, and provides features like polling, revalidation on focus, request deduplication, and error retry.

## Use cases
- fetch remote data in Vue components with automatic caching
- show stale data instantly while revalidating in the background
- poll an API at intervals to keep the UI up to date
- deduplicate duplicate in-flight requests across components
- refetch data when the window regains focus
- retry failed requests with stale-if-error fallback
- plug in a custom cache like localStorage

## When to avoid
- you need SSR support, which was removed as of version 0.10.0
- your project uses React (use the swr library instead)
- you need a full state management solution rather than a data-fetching hook
- you're on Vue 2.6 or below and can't use an older release

## Facets
- artifact type: library
- maturity: active
- function: http-client, caching, state-management, middleware
- domain: frontend, web-development, developer-tools
- platform: browser, cross-platform
- tags: vue, swr, stale-while-revalidate, data-fetching, composition-api, typescript, reactivity, nodejs

## Member repositories
- Kong/swrv (main) score 79

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:33.529994+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:41:25.740317+00:00, confidence not recorded.
  - readme: https://github.com/Kong/swrv (fetched 2026-08-28T04:06:33.529994+00:00, sha e67bbca6d93f)
  - homepage: https://docs-swrv.netlify.app (fetched 2026-08-29T10:22:07.712001+00:00, sha 71bd4f9a908b)
  - registry_npm: https://registry.npmjs.org/swrv (fetched 2026-08-29T10:22:07.720735+00:00, sha dd62e57ba722)
- Data as of 2026-08-30T08:39:29.467469+00:00.
