Packages narrative
packages / next-build-notifier

next-build-notifier

Functions

NameDescription
withBuildNotifierWraps a Next.js config so the running client knows its own build id: bakes
reloadHard-reloads the document to fetch the new deployment's assets. SSR-safe no-op when
useBuildNotificationReads the live build-notification state from the nearest
useBuildNotifierEngineThe polling/compare/dismiss engine behind
createVersionRouteCreates a Next.js App Router route handler that serves the current deployment's build id as
resolveBuildIdResolves a single canonical build identifier from the environment so the client (baked at build time) and the version endpoint (read at runtime) always derive their id from the same source. Next's deployment id wins when present so the baked client id matches Next's native

Components

NameDescription
BuildNotifierHeadless render-prop over the build-notification state from the nearest provider. Renders exactly what the function returns — no markup or styles of its own.
BuildNotifierProviderRuns the build-notifier engine and publishes its state via context. Place high in the tree; render UI with

Types

NameDescription
WithBuildNotifierOptionsOptions for
BuildNotificationStateThe reactive state + actions exposed by the engine, context hook, and render-prop.
BuildNotifierConfigConfiguration for the build notifier engine, provider, and render-prop.
BuildNotifierPropsProps for
BuildNotifierProviderPropsProps for
VersionResponseThe shape returned by the version endpoint.
BuildIdEnvThe subset of environment variables
CreateVersionRouteOptionsOptions for

Other

NameDescription
BuildIdEnv
resolveBuildId

On this page