Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-react-uikit-v7.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Class | CometChatUIKit |
| Package | @cometchat/chat-uikit-react |
| Usage | Static methods — no instantiation needed |
| Note | Most users don’t need these directly — CometChatProvider handles init and login automatically |
Overview
CometChatUIKit is a static class that provides imperative methods for SDK initialization, authentication, and message sending. Most users won’t need these directly — CometChatProvider handles init and login automatically. These methods are useful for:
- The individual providers approach
- Sending messages programmatically outside the composer
- Checking initialization/login state
Initialization
CometChatUIKit.init(settings)
Initialize the CometChat SDK and UIKit.
| Parameter | Type | Description |
|---|---|---|
settings | UIKitSettings | Built via UIKitSettingsBuilder |
Promise<CometChat.User | null> — the logged-in user if a session exists, otherwise null.
What it does:
- Initializes the CometChat SDK with app settings
- Sets source metadata for analytics
- Creates the plugin registry (default + user plugins)
- Initializes the localization singleton
- Resumes existing session (if any)
- Initializes Calls SDK (if enabled)
Authentication
CometChatUIKit.login(uid)
Log in a user by UID. Requires authKey in UIKitSettings.
| Parameter | Type | Description |
|---|---|---|
uid | string | The user’s UID |
Promise<CometChat.User>
CometChatUIKit.loginWithAuthToken(authToken)
Log in with a server-generated auth token. Preferred for production.
| Parameter | Type | Description |
|---|---|---|
authToken | string | Server-generated auth token |
Promise<CometChat.User>
CometChatUIKit.logout()
Log out the current user.
Promise<void>
State Getters
CometChatUIKit.getLoggedInUser()
Get the currently logged-in user (synchronous).
CometChat.User | null
CometChatUIKit.isInitialized()
Check if the SDK has been initialized.
boolean
CometChatUIKit.isCallingReady()
Check if the Calls SDK is ready.
Returns: boolean
CometChatUIKit.getPluginRegistry()
Get the plugin registry instance.
Returns: CometChatPluginRegistry | null
CometChatUIKit.getSettings()
Get the UIKitSettings used during initialization.
Returns: UIKitSettings | null
CometChatUIKit.getConversationUpdateSettings()
Get conversation update settings fetched from the dashboard.
Returns: CometChat.ConversationUpdateSettings | null
Message Sending
CometChatUIKit.sendTextMessage(message)
Send a text message. Sets muid and sentAt if not already set.
Promise<CometChat.BaseMessage>
CometChatUIKit.sendMediaMessage(message)
Send a media message (image, video, audio, file).
Promise<CometChat.BaseMessage>
CometChatUIKit.sendCustomMessage(message)
Send a custom message (polls, location, etc.).
Promise<CometChat.BaseMessage>