https://github.com/atrakh/vercel-version-notifications
Tell your users there's a new version of your next.js app
https://github.com/atrakh/vercel-version-notifications
Last synced: over 1 year ago
JSON representation
Tell your users there's a new version of your next.js app
- Host: GitHub
- URL: https://github.com/atrakh/vercel-version-notifications
- Owner: atrakh
- License: mit
- Created: 2024-04-29T21:21:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T18:44:55.000Z (almost 2 years ago)
- Last Synced: 2025-03-02T07:04:00.949Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Example of how to use Vercel's deployment APIs to determine whether the loaded next.js application is running the latest code on production.
## How to use
Set `VERCEL_TOKEN` to a Vercel API Access Token scoped to your project.
Update the `teamId`, `projectId`, and `productionBranchUrl` constants in `pages/api/index.tsx` to match your team and project's information.
The UI for this application simply renders the results of the API call, and the currently loaded version (exposed as an environment variable in `next.config.js`). You can extend this to poll the version API and display a message to the user if they are not running the latest version.