Inject and display build metadata in your Next.js app deployed on Vercel:
- App version from
package.json
- Commit SHA from Vercel git env vars
- Build time generated once per
next build
- Read
package.json
for the app version. - Capture current ISO timestamp at build.
- Use Vercel-provided env vars for repo + commit details.
- Expose everything through
NEXT_PUBLIC_*
so it’s available in SSR and client code. - Render in a shared component (e.g. footer).
VERCEL_GIT_REPO_OWNER
VERCEL_GIT_REPO_SLUG
VERCEL_GIT_COMMIT_SHA