# SWR

SWR is a React Hooks library for data fetching. The name comes from stale-while-revalidate: it first returns data from cache (stale), then sends the fetch request (revalidate), and finally comes with the up-to-date data.

This file helps AI agents understand and use this documentation site.

## Documentation Surfaces

- [Docs](https://swr.vercel.app/docs): Documentation section: docs
- [Blog](https://swr.vercel.app/blog): Documentation section: blog
- [Examples](https://swr.vercel.app/examples): Documentation section: examples
- [Full documentation context](https://swr.vercel.app/llms.txt): All configured documentation as Markdown
- [Semantic documentation sitemap](https://swr.vercel.app/sitemap.md): High-level documentation map for agent navigation
- Page-level Markdown: append .md or .mdx to a documentation URL

## When to use SWR

- Category: Data fetching
- Audience: React developers, Next.js developers
Common use cases:

- Fetch, cache, and revalidate remote data in React applications
- Build fast, reactive UIs with automatic revalidation
- Handle pagination, mutations, and optimistic UI updates

## Important Links

- [Docs](https://swr.vercel.app/docs)
- [Blog](https://swr.vercel.app/blog)
- [Examples](https://swr.vercel.app/examples)
- [SWR source](https://github.com/vercel/swr): Source repository for the SWR library
- [SWR docs source](https://github.com/vercel/swr-site): Source repository for this documentation site
- [GitHub repository](https://github.com/vercel/swr): Source repository

## Agent Instructions

- Use /sitemap.md to identify the most relevant documentation pages before answering broad questions.
- Use /llms.txt when you need the complete documentation corpus as Markdown context.
- Fetch individual documentation pages with a .md or .mdx extension for focused page-level context.
- Only use product capabilities and integration surfaces that are explicitly listed in this file.
