Menu
NextToolbar

Server Actions

Every action call from the page: status, time, what it revalidated and where it redirected. Plus a Refresh button.

Every Server Action call from the page shows up in the toolbar: whether it worked, how long it took, whether it told the router to throw away cached data, and where it redirected. A Refresh page button renders the current route again on the server, without reloading.

What you see

A lightning segment with the number of calls since the page loaded. It turns red when one of them failed.

Hover it to open the list, newest first:

ColumnWhat it shows
ActionThe start of the action id, and the page it was called from. Hover a row for the full id.
StatusHTTP status of the action's response, failed when the request itself failed (network, aborted), … while it runs. A throw inside the action is a 500.
TimeUntil the response headers arrived. The action's result streams in after that.
RevalidatedWhat the action told the client router to invalidate (below), and → /path when it redirected.

The list lives in the browser: it survives client navigations and is lost on a full reload. Clear empties it.

The live demo shows three calls in the "Account" scenario, one of them failed.

Revalidated

ValueMeaningCaused by
static + dynamicThe router drops all its cached data, static included.revalidatePath, updateTag, setting or deleting a cookie.
dynamic onlyThe router refetches dynamic data only.refresh()
—Nothing to invalidate.No revalidation, or revalidateTag with a cache profile (see below).

On Next.js 16, revalidateTag(tag, profile) is stale-while-revalidate: the next visit gets the old data while the new one is fetched. Next doesn't tell the client about it, so the column shows — even though the tag was revalidated on the server.

Refresh page

Calls router.refresh(): Next renders the current route again on the server and merges the result into the page, keeping client state (inputs, scroll, useState). It doesn't clear the data cache: cached fetch calls and 'use cache' entries are reused. Use it to see the page after changing data outside the app (a database, a CMS).

Revalidate from the toolbar

With the server route mounted, the bottom of the panel revalidates the server cache and then refreshes the page:

app/api/next-toolbar/route.ts
ts
export { GET, POST } from '@angelitolm/next-toolbar/server'
ButtonRuns on the server
This pagerevalidatePath(<current path>)
EverythingrevalidatePath('/', 'layout'): every path
TagrevalidateTag(<tag>, { expire: 0 }): the tag expires now, the next request fetches fresh data

Type the tag you pass to fetch(url, { next: { tags: [...] } }) or cacheTag(). The toolbar can't list them: the browser never sees them.

The same route gives the toolbar the names of your Server Actions (likePost instead of 7f3a2c9d1e…); hover a row to see the file it's defined in.

Without the route, the panel shows how to add it.

Where the data comes from

Server Actions are POST requests that carry a next-action header with the action id. The toolbar wraps window.fetch while it's mounted (in next dev, or on a staging server) and records the requests that have that header. The response goes to Next untouched: the toolbar only reads its status and two headers, x-action-revalidated and x-action-redirect. Both formats are read: a number on Next.js 16, a [paths, tag, cookie] tuple on Next.js 15.

What it doesn't do

  • No action names without the server route. The browser only sees ids; the names live in Next's manifests on the server, which the server route reads.
  • No tags or paths in the Revalidated column: Next only sends the client a flag, not which tags or paths were revalidated.
  • No arguments or return values. They travel in React's own format in the request and response bodies, which the toolbar doesn't read.
  • Actions called from other tabs, or with a fetch that isn't the global one, aren't seen.