Skip to content

Latest commit

 

History

History

next.js

Next.js and TalkJS example

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.

[!TIP] > Download this example project as a zip file

Prerequisites

To run this tutorial, you will need:

How to run the tutorial

  1. Clone or download this project.
  2. Replace <APP_ID> in app/page.js with the value found in the Settings tab of your TalkJS dashboard.
  3. Run npm install to install dependencies.
  4. Run npm run dev to start the server.
  5. Visit http://localhost:3000.

You should see a page which loads a chatbox on startup.