next-js-examples
next-js-examples copied to clipboard
Deprecated
This repository is deprecated, for Next.js examples please use:
- https://github.com/liveblocks/liveblocks/tree/main/examples/nextjs-live-avatars
- https://github.com/liveblocks/liveblocks/tree/main/examples/nextjs-todo-list
- https://github.com/liveblocks/liveblocks/tree/main/examples/nextjs-whiteboard
- https://github.com/liveblocks/liveblocks/tree/main/examples/nextjs-live-cursors
Liveblocks × Next.js.
This repo shows how to use Liveblocks with Next.js.
Getting started
Run examples locally
- Install all dependencies with
npm install - Create an account on liveblocks.io
- Copy your secret key from the administration
- Create a file named
.env.localand add your Liveblocks secret as environment variableLIVEBLOCKS_SECRET_KEY=sk_test_yourkey - Run
npm run devand go to http://localhost:3000
Run examples on CodeSandbox
- Open this repository on CodeSandbox with this link
- Create an account on liveblocks.io
- Copy your secret key from the administration
- Create secret named
LIVEBLOCKS_SECRET_KEYwith the secret key you just copied. You need to create an account on CodeSandbox to add an environment variable. - Refresh your browser and you should be good to go!