This example accompanies our Add chat to a Next.js app with TalkJS tutorial. It demonstrates how to integrate TalkJS into a Next.js project using our React SDK.
The React SDK is not able to render components on the server, so we use Next.js's Client Components to render them on the client.
This example uses React version 18.
To run this tutorial, you will need:
- Clone or download this project.
- Replace
<APP_ID>
inapp/page.js
with the value found in the Settings tab of your TalkJS dashboard. - Run
npm install
to install dependencies. - Run
npm run dev
to start the server. - Visit http://localhost:3000.
You should see a page which loads a chatbox on startup.