Skip to main content
The UI Kit wraps the Chat SDK methods to manage internal eventing and keep UI components synchronized. Use these wrapper methods instead of raw SDK calls.
CometChatUIKit.init(UIKitSettings) must be called before rendering any UI Kit components or calling any SDK methods. Initialization must complete before login.
Auth Key is for development/testing only. In production, generate Auth Tokens on the server using the REST API and pass them to the client. Never expose Auth Keys in production client code.

Methods

All methods are accessed via the CometChatUIKit class.

Init

Initializes the CometChat React Native SDK. Must be called on app startup before any other UI Kit method.
Replace APP_ID, REGION, and AUTH_KEY with values from the CometChat Dashboard. Auth Key is optional — use Auth Token for production.

Login using Auth Key

Simple authentication for development/POC. For production, use Auth Token.

Login using Auth Token

Production-safe authentication that does not expose the Auth Key in client code.
  1. Create a User via the CometChat API when the user signs up in your app.
  2. Create an Auth Token via the CometChat API for the new user and save the token in your database.
  3. Load the Auth Token in your client and pass it to the login() method.

Logout

Ends the current user session.

Create User

Takes a User object and returns the created User object.

Update User

Takes a User object and returns the updated User object.

Sending Messages

Text Message

Sends a text message in a 1:1 or group chat.

Media Message

Sends a media message in a 1:1 or group chat.

Custom Message

Sends a custom message (neither text nor media) in a 1:1 or group chat.

Interactive Messages

Form Message

Sends a Form message which is an extension of Interactive Message.

Card Message

Sends a Card message which is an extension of Interactive Message.

Custom Interactive Message

Sends a CustomInteractive message which is an extension of Interactive Message.

UIKitSettings

UIKitSettings is an object containing credentials to initialize CometChat SDK.

Next Steps

Integration

Complete guide to integrating the UI Kit

Events

Listen to UI Kit events for custom behavior

Components Overview

Explore all available UI components

Theme

Customize the look and feel of the UI Kit