AI Integration Quick Reference
AI Integration Quick Reference
Prerequisites
You need three things from the CometChat Dashboard:
You also need Node.js 18+ and npm/yarn installed.
Step 1 — Create a React Project
- Vite (recommended)
- Create React App
Step 2 — Install the UI Kit
- npm
- yarn
Step 3 — Render with CometChatProvider
Wrap your app inCometChatProvider with your credentials. It handles SDK initialization, login, and all internal context setup automatically.
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
src/App.tsx
CometChatProvider handles init, login, plugin registration, theming, locale, and real-time events — no manual setup needed. For advanced use cases (custom login flows, individual providers), see the CometChatProvider guide.
For production, use the
authToken prop instead of authKey + uid. Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.Step 4 — Run
http://localhost:5173 (Vite) or http://localhost:3000 (CRA). 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.Next Steps
Components Overview
Browse all prebuilt UI components
Theming
Customize colors, fonts, and styles
Plugins
Customize message rendering
Troubleshooting
Common issues and fixes