Skip to content

LiveLike/ll-nextjs-demo

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Setup:

1. Install dependencies:
npm install
2. Install nvm

Nvm is needed to locally link @livelike/javascript and install its dependencies.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

Add below lines in your .bashrc or .zshrc file

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Check nvm available in CLI and install node v18.12.1

nvm install v18.12.1
3. Clone websdk repo branch with engagement-api changes and link engagement-api

Inside cloned repo with proper checked out branch

cd release/javascript

This globally links @livelike/javascript package

npm link
4. Add @livelike/javascript dependencies in package.json
dependencies: {
    "@livelike/javascript": "0.0.0",
}
5. Locally link @livelike/javascript
npm run link-api

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000/chatroom/6c5577e7-95cf-40ff-9a29-a6f57d0da322 with your browser to see the chat message. You can replace url chatroom Id with any other chat room id

You can start editing the page by modifying pages/chatroom/[roomId].tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

About

Next Js Demo app using our Javascript SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages