AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Package | @cometchat/chat-uikit-react v7.0.x |
| Peer deps | react >=18, react-dom >=18, @cometchat/chat-sdk-javascript ^4.1.9, dompurify ^3.3.1 |
| Init | CometChatUIKit.init(UIKitSettings) — must resolve before login() |
| Login | CometChatUIKit.login("UID") — must resolve before rendering components |
| Order | init() → login() → render <CometChatProvider>. Breaking this order = blank screen |
| Auth Key | Dev/testing only. Use loginWithAuthToken in production |
| SSR | CometChat components must be loaded with dynamic(() => import(...), { ssr: false }) |
| Calling | Optional. Install @cometchat/calls-sdk-javascript and call .setCallingEnabled(true) on UIKitSettingsBuilder |
| Other frameworks | React.js · React Router · Astro |

Prerequisites
You need three things from the CometChat Dashboard:| Credential | Where to find it |
|---|---|
| App ID | Dashboard → Your App → Credentials |
| Auth Key | Dashboard → Your App → Credentials |
| Region | Dashboard → Your App → Credentials (e.g. us, eu, in) |
Step 1 — Create a Next.js Project
Step 2 — Install the UI Kit
- npm
- yarn
Step 3 — Create the CometChat Client Component
CometChat uses browser APIs and cannot run in Server Components. Create a'use client' component that initializes the SDK, logs in, and renders your chat UI inside CometChatProvider.
For development, use one of the pre-created test UIDs:
cometchat-uid-1 · cometchat-uid-2 · cometchat-uid-3 · cometchat-uid-4 · cometchat-uid-5
app/CometChatClient.tsx
'use client' is required because CometChat components use browser APIs. Init and login happen in a useEffect, and the provider only mounts after login succeeds. See the CometChatProvider guide for all provider props.
For production, use
CometChatUIKit.loginWithAuthToken(token) instead of login(uid). Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.Step 4 — Import with SSR Disabled
In your page file, usedynamic() with ssr: false to prevent the CometChat component from rendering on the server.
app/page.tsx
Step 5 — Run
http://localhost:3000. You should see the conversation list on the left. Click a conversation to open the message panel.

Choose a Chat Experience
Conversation List + Message View
Two-panel layout — conversation list on the left, messages on the right.
One-to-One / Group Chat
Single chat window — no sidebar. Good for support chat or embedded widgets.
Tab-Based Chat
Tabbed navigation — Chat, Call Logs, Users, Settings in separate tabs.
Build Your Own Chat Experience
Need full control over the UI? Use individual components, customize themes, and wire up your own layouts.- Sample App — Working reference app to compare against
- Components — All prebuilt UI elements with props and customization options
- Core Features — Messaging, real-time updates, and other capabilities
- Theming — Colors, fonts, dark mode, and custom styling
- Build Your Own UI — Skip the UI Kit entirely and build on the raw SDK
Next Steps
Components Overview
Browse all prebuilt UI components
Theming
Customize colors, fonts, and styles
Plugins
Customize message rendering
Troubleshooting
Common issues and fixes