Skip to main content
Message Privately lets users start a direct 1:1 conversation with a group member without leaving the group context. The user can return to the group after the private chat. Before starting, complete the Getting Started guide for your framework.

Components


Integration Steps

1. Group Member Click Handler

When a group member is clicked, cast them to a User object and initiate a private chat. The current group is saved so the user can return to it later. CometChat.getConversation() fetches or creates the 1:1 conversation. File: CometChatHome.tsx

2. Group Members with Private Messaging Option

Add a “Message Privately” option to the group members list. The options prop adds a context-menu action that triggers the private chat flow when clicked. File: CometChatHome.tsx

3. Private Chat Interface

Render a full chat view (header, message list, composer) for the 1:1 conversation. The header includes a back button that returns the user to the original group, and a subtitle showing which group the private chat was initiated from. File: CometChatHome.tsx

4. State Management

Add reducer cases to track the group the user came from, whether the private chat is visible, and which user is being messaged. This lets the app restore the group context when the user navigates back. File: appReducer.ts

Feature Matrix


Next Steps

Group Members

Display and manage group member lists.

Message List

Render real-time message threads.

All Guides

Browse all feature and formatter guides.

Sample App

Full working sample application on GitHub.