App ID
, AuthKey
, and Region
of your CometChat application when initializing the UI Kit.
i. Register on CometChat
Next.js
app. You can follow the Next.js Documentation to create a new app.Create a project
Add Dependency
Initialize CometChat UI Kit
UIKitSettings
Class. It is intended for use primarily during proof-of-concept (POC) development or in the early stages of application development. You can use the Auth Token method to log in securely.Login User
UIKitSettings
Class. It is intended for use primarily during proof-of-concept (POC) development or in the early stages of application development. You can use the Auth Token method to log in securely.Render Conversations
CometChatNoSSR.tsx
inside the src/pages
folder of your project. Here we will initialize CometChat UI Kit, login a user & then launch Conversations component.CometChatNoSSR.tsx
file only. This change will be done in index.tsx
file.global.css
file in the src/styles
folder to import CometChat UI Kit’s CSS file & a few cosmetic changes.Run the project
Tabs
component which will render the different tabs and on change we can render different components. Create a folder CometChatTabs
in src/pages
folder. And add the below code,
Sidebar
component which will render the different components(Conversations, Users, Groups, Calls). Create a folder CometChatSelector
in src/pages
folder. And add the below code,
CometChatNoSSR.tsx
& CometChatNoSSR.css
files to import these new components as below,