CheckForApplicationUpdate

Polls the deployed page and shows a notification once a new build is live. Renders nothing until then.

Installation

pnpm dlx shadcn@latest add @chelone/check-for-application-update

Polls the deployed page and shows a notification once a new build is live. Renders nothing until then.

Props

PropTypeDefaultDescription
disabledboolean—Never fetch. Defaults to `true` outside production.
fetchOptionsRequestInit | () => RequestInit—Read at each check. `cache: "no-store"` always overrides it.
intervalnumber—Milliseconds between checks. Defaults to one hour.
notificationReactNode—Shown once a new build is found. Defaults to `<ApplicationUpdatedNotification />`.
onNewVersionAvailable() => void—Called once, when the first change is seen.
urlstring—Page to fingerprint. Defaults to `${location.origin}/index.html`, read at each check.