MENU
Function Reference
This chapter is a consolidated, terse lookup reference for Next.js's built-in functions, hooks, and components. Everything here is already used and explained in context throughout the rest of this site -- this chapter exists so you can look a function up quickly without re-reading a full chapter, rather than to teach these APIs from scratch.
Each page below is a scannable table: function or component name, then a one- or two-sentence reminder of what it does and where you're allowed to call it. Where a fuller explanation already exists elsewhere on this site, the table row links out to it.
In This Chapter
- Routing Functions -- redirect(), notFound(), forbidden(), unauthorized(), and the client-side useRouter() family of hooks.
- Data and Cache Functions -- revalidatePath(), revalidateTag(), unstable_cache(), and fetch()'s Next.js-specific caching options.
- Headers and Cookies Functions -- cookies(), headers(), and draftMode() from next/headers.
- Metadata Functions -- generateMetadata(), generateStaticParams(), generateViewport(), and generateSitemaps().
- Component Reference -- the built-in components you import throughout an app: Image, next/font, Script, Link, and Form.
Unless noted otherwise, "Server Component" also implies these functions work in Server Actions and Route Handlers, since all three run exclusively on the server.