An open API service indexing awesome lists of open source software.

https://github.com/liveblocks/next-js-examples


https://github.com/liveblocks/next-js-examples

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          





# 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-live-avatars)
- [https://github.com/liveblocks/liveblocks/tree/main/examples/nextjs-todo-list](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-whiteboard)
- [https://github.com/liveblocks/liveblocks/tree/main/examples/nextjs-live-cursors](https://github.com/liveblocks/liveblocks/tree/main/examples/nextjs-live-cursors)

## [Liveblocks](https://liveblocks.io) × [Next.js](https://nextjs.org/).

This repo shows how to use Liveblocks with [Next.js](https://nextjs.org/).

## Getting started

### Run examples locally

- Install all dependencies with `npm install`
- Create an account on [liveblocks.io](https://liveblocks.io/dashboard)
- Copy your secret key from the [administration](https://liveblocks.io/dashboard/apikeys)
- Create a file named `.env.local` and add your Liveblocks secret as environment variable `LIVEBLOCKS_SECRET_KEY=sk_test_yourkey`
- Run `npm run dev` and go to [http://localhost:3000](http://localhost:3000)

### Run examples on CodeSandbox

- Open this repository on CodeSandbox with this [link](https://codesandbox.io/s/github/liveblocks/next-js-examples?file=/pages/live-cursors-basic.js)
- Create an account on [liveblocks.io](https://liveblocks.io/dashboard)
- Copy your secret key from the [administration](https://liveblocks.io/dashboard/apikeys)
- Create [secret](https://codesandbox.io/docs/secrets) named `LIVEBLOCKS_SECRET_KEY` with 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!