https://github.com/ctnicholas/nextjs-realtime-cache-update
https://github.com/ctnicholas/nextjs-realtime-cache-update
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ctnicholas/nextjs-realtime-cache-update
- Owner: CTNicholas
- Created: 2024-01-16T12:03:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T17:55:19.000Z (over 2 years ago)
- Last Synced: 2025-02-14T22:48:07.128Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://nextjs-realtime-cache-update.vercel.app
- Size: 77.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Liveblocks + Next.js real-time caching
This demo shows you how to implement real-time Next.js caching/revalidating with [Liveblocks](https://liveblocks.io/). No data is stored on Liveblocks to make this work, it simply tells other users to refresh their data from your database.
https://github.com/CTNicholas/nextjs-realtime-cache-update/assets/33033422/1a27992a-fcec-4182-b3cf-0097c4098bcb
### Set up Liveblocks
- Install all dependencies with `npm install`
- Create an account on [liveblocks.io](https://liveblocks.io/dashboard)
- Copy your **secret** key from the [dashboard](https://liveblocks.io/dashboard/apikeys)
- Create an `.env.local` file and add your **secret** key as the `LIVEBLOCKS_SECRET_KEY` environment variable
- Run `npm run dev` and go to [http://localhost:3000](http://localhost:3000)