AI Agent Component Spec
AI Agent Component Spec
- Package:
@cometchat/chat-uikit-react - Framework: React Router
- Key components:
CometChatMessageHeader+CometChatMessageList+CometChatMessageComposer - Required setup:
CometChatUIKit.init(UIKitSettings)thenCometChatUIKit.login("UID") - Parent guide: React Router Integration
User Interface Preview

Key Components
- Chat Header — recipient details and optional call/video buttons
- Message View — real-time chat history
- Message Composer — text input with media, emoji, and reaction support
Step-by-Step Guide
Add the Message Composer
Implementation
CreateCometChatNoSSR.tsx and CometChatNoSSR.css files to initialize the UI Kit, log in a user, and render the messaging experience.- TypeScript
- CSS
CometChatNoSSR.tsx
Fetching a User (One-on-One Chat)
Fetching a Group (Group Chat)
Disable SSR and Render the CometChat Component
Create a file CometChat.tsx inside the routes folder:Create a route for CometChat in the routes file:
CometChat UI Kit relies on browser APIs (window, document, WebSockets). Since React Router renders on the server by default, disabling SSR for this component prevents runtime errors.