
API Reference for Next.js Functions and Hooks
Beyond file conventions and directives, the App Router exposes a substantial set of importable functions and hooks — the actual verbs of the framework, as opposed to the file-naming nouns covered elsewhere in the API Reference. This is the index page for that whole family: dozens of functions covering caching, navigation, request data, metadata generation, and more, most of which have their own dedicated, in-depth article elsewhere in this blog.
Why This List Is Worth Skimming Even If You Never Read It Top to Bottom
The value of this particular index isn't reading it start to finish — it's recognizing, at a glance, that a function you need probably already exists here before you reach for a workaround. A few groupings worth being aware of even before you need them:
Caching and revalidation: cacheLife, cacheTag, revalidatePath, revalidateTag, updateTag, unstable_cache, unstable_noStore — a cluster of functions covering both the newer Cache-Components-era caching model and the previous fetch-based one, depending on which model your project has adopted.
Request-time data access: cookies, headers, connection, draftMode, root-params, userAgent — the ways to reach into the incoming request from a Server Component, Route Handler, or Server Function.
Navigation and routing: redirect, permanentRedirect, notFound, forbidden, unauthorized, refresh, and the client-side hooks useRouter, usePathname, useParams, useSearchParams, useSelectedLayoutSegment(s), useLinkStatus, useOffline.
Metadata and image generation: generateMetadata, generateViewport, generateImageMetadata, generateSitemaps, generateStaticParams, and the ImageResponse constructor.
Error handling: catchError, working alongside the error.js file convention rather than replacing it, for component-level (not just route-segment-level) error recovery.
Deferred work: after, for scheduling work to run once a response has already been sent, without blocking that response.
Low-level request/response objects: NextRequest and NextResponse, the extended Web API types used throughout Route Handlers and Proxy.
The extended fetch: Next.js's own fetch function, extending the Web fetch API with caching and revalidation options baked directly into the call itself.
A Pattern Worth Noticing: Paired Functions
Several entries in this list only make sense in relation to a sibling function or file convention, and it's worth knowing the pairing exists before you go looking for "the other half":
forbidden()pairs with theforbidden.jsfile convention.unauthorized()pairs withunauthorized.js.notFound()pairs withnot-found.js.cacheTag()pairs withrevalidateTag()andupdateTag()— one tags a cache entry, the others invalidate by that tag.cacheLife()works alongside theuse cachedirective, not standalone.catchError()is the component-level, programmatic counterpart to the route-segment-scopederror.jsfile convention — the docs are explicit that you don't need to wrap anerror.jsdefault export incatchError, sinceerror.jsalready gets a built-in boundary from Next.js itself.
Key Takeaways
| Category | Representative functions |
|---|---|
| Caching/revalidation | cacheLife, cacheTag, revalidateTag, revalidatePath, updateTag |
| Request data | cookies, headers, connection, draftMode |
| Navigation | redirect, notFound, forbidden, unauthorized, useRouter, usePathname |
| Metadata/images | generateMetadata, generateSitemaps, generateStaticParams, ImageResponse |
| Error handling | catchError (component-level), paired with error.js (segment-level) |
| Deferred work | after |
This list will keep growing as the framework does — treat it as a reference to search, not memorize, and check back here whenever you find yourself about to hand-roll something (deferred logging, tag-based cache invalidation, component-level error recovery) that a dedicated Next.js function might already solve more cleanly.


