Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion sdk/javascript/pin-conversation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</Tab>
</Tabs>

A user cannot unpin an admin-global pin — that call is rejected with `ERR_ACTION_NOT_ALLOWED`. Hide or disable the unpin control for conversations you know are system-pinned.
A user cannot unpin an admin-global pin — that call is rejected with `ERR_SYSTEM_PINNED_CONVERSATION`. Hide or disable the unpin control for conversations you know are system-pinned.

## Fetch Pinned Conversations

Expand All @@ -95,7 +95,7 @@
<Tabs>
<Tab title="TypeScript">
```typescript
let conversationsRequest: CometChat.ConversationsRequest =

Check warning on line 98 in sdk/javascript/pin-conversation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-conversation.mdx#L98

Did you really mean 'conversationsRequest'?
new CometChat.ConversationsRequestBuilder()
.setPinnedBy([CometChat.PINNED_BY.SYSTEM, CometChat.PINNED_BY.ME])
.setLimit(30)
Expand All @@ -113,7 +113,7 @@
</Tab>
<Tab title="JavaScript">
```javascript
let conversationsRequest = new CometChat.ConversationsRequestBuilder()

Check warning on line 116 in sdk/javascript/pin-conversation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-conversation.mdx#L116

Did you really mean 'conversationsRequest'?
.setPinnedBy([CometChat.PINNED_BY.ME])
.setLimit(30)
.build();
Expand Down Expand Up @@ -218,7 +218,7 @@
<Tab title="TypeScript">
```typescript
let limit: number | null = await CometChat.getPinnedConversationsLimit();
let systemLimit: number | null =

Check warning on line 221 in sdk/javascript/pin-conversation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-conversation.mdx#L221

Did you really mean 'systemLimit'?
await CometChat.getSystemPinnedConversationsLimit();
```
</Tab>
Expand All @@ -233,6 +233,53 @@

Both resolve to `null` when the app settings carry no value. `getSystemPinnedConversationsLimit()` is the separate admin/global cap, enforced independently.

## Error Handling

`pinConversation()` and `unpinConversation()` reject with a `CometChatException`. Branch on the code rather than the message text:

| Code | Meaning |
| --- | --- |
| `ERR_PINNED_CONVERSATIONS_LIMIT_EXCEEDED` | The user's conversation pin cap was reached (HTTP 400). |
| `ERR_UID_NOT_FOUND` / `ERR_GUID_NOT_FOUND` | The peer named by `conversationWith` does not exist (HTTP 404). |
| `ERR_SYSTEM_PINNED_CONVERSATION` | The conversation is **system-pinned** (admin-global), which a user may never unpin. |

Pins are per-user, so pinning a conversation never affects anyone else's list. Check `conversation.isSystemPinned()` and hide the unpin control rather than letting the call fail.

Check warning on line 246 in sdk/javascript/pin-conversation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-conversation.mdx#L246

Did you really mean 'else's'?

Both calls are idempotent: unpinning a conversation that was never pinned succeeds rather than erroring.

Check warning on line 248 in sdk/javascript/pin-conversation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-conversation.mdx#L248

Did you really mean 'erroring'?

<Tabs>
<Tab title="TypeScript">
```typescript
CometChat.pinConversation("uid", "user").then(
(response: CometChat.BaseMessage) => {
console.log("Done:", response);
},
(error: CometChat.CometChatException) => {
// e.g. code: "ERR_PINNED_CONVERSATIONS_LIMIT_EXCEEDED"
console.log(error.code, error.message);
}
);
```
</Tab>
<Tab title="JavaScript">
```javascript
CometChat.pinConversation("uid", "user").then(
(response) => {
console.log("Done:", response);
},
(error) => {
// e.g. code: "ERR_PINNED_CONVERSATIONS_LIMIT_EXCEEDED"
console.log(error.code, error.message);
}
);
```
</Tab>
</Tabs>

<Note>
Read the cap from `CometChat.getPinnedConversationsLimit()`, which resolves to the configured cap, or `null` when unset — so you can name the exact number in your own copy without parsing it out of the error text.
</Note>

## Feature Availability

<Tabs>
Expand Down
46 changes: 45 additions & 1 deletion sdk/javascript/pin-message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Note>
Pinning is a moderation action. Only an Admin or Moderator — a group owner
included — may pin or unpin. The server is the authority: a member's call is
rejected with `ERR_ACTION_NOT_ALLOWED`.
rejected with `ERR_PERMISSION_DENIED`.
</Note>

## Pin a Message
Expand All @@ -18,7 +18,7 @@
<Tabs>
<Tab title="TypeScript">
```typescript
let messageId: number = 100;

Check warning on line 21 in sdk/javascript/pin-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-message.mdx#L21

Did you really mean 'messageId'?

CometChat.pinMessage(messageId).then(
(message: CometChat.BaseMessage) => {
Expand All @@ -32,7 +32,7 @@
</Tab>
<Tab title="JavaScript">
```javascript
let messageId = 100;

Check warning on line 35 in sdk/javascript/pin-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-message.mdx#L35

Did you really mean 'messageId'?

CometChat.pinMessage(messageId).then(
(message) => {
Expand All @@ -46,7 +46,7 @@
</Tab>
</Tabs>

Pinning is **idempotent**, and a message has a single pinner: re-pinning an already pinned message updates `pinnedBy` and `pinnedAt` to the most recent pinner rather than failing.

Check warning on line 49 in sdk/javascript/pin-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-message.mdx#L49

Did you really mean 'pinner'?

Check warning on line 49 in sdk/javascript/pin-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-message.mdx#L49

Did you really mean 'pinner'?

## Unpin a Message

Expand Down Expand Up @@ -86,7 +86,7 @@
<Tabs>
<Tab title="TypeScript">
```typescript
let messagesRequest: CometChat.MessagesRequest =

Check warning on line 89 in sdk/javascript/pin-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-message.mdx#L89

Did you really mean 'messagesRequest'?
new CometChat.MessagesRequestBuilder()
.setUID("cometchat-uid-1")
.setPinned(true)
Expand All @@ -105,7 +105,7 @@
</Tab>
<Tab title="JavaScript">
```javascript
let messagesRequest = new CometChat.MessagesRequestBuilder()

Check warning on line 108 in sdk/javascript/pin-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-message.mdx#L108

Did you really mean 'messagesRequest'?
.setGUID("cometchat-guid-1")
.setPinned(true)
.setLimit(50)
Expand Down Expand Up @@ -168,7 +168,7 @@
| ------------------- | -------------------------------------------------------------------------- |
| `isPinned()` | `true` when the message is pinned. |
| `getPinnedAt()` | The pin timestamp, or `undefined`. |
| `getPinnedBy()` | The UID of the most recent pinner, or `undefined`. |

Check warning on line 171 in sdk/javascript/pin-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-message.mdx#L171

Did you really mean 'pinner'?
| `isSystemPinned()` | `true` for an admin/global pin. Render it as a system pin, not as a user. |

## Real-time Pin Events
Expand Down Expand Up @@ -218,7 +218,7 @@
<Tab title="TypeScript">
```typescript
let limit: number | null = await CometChat.getPinnedMessagesLimit();
let systemLimit: number | null =

Check warning on line 221 in sdk/javascript/pin-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/pin-message.mdx#L221

Did you really mean 'systemLimit'?
await CometChat.getSystemPinnedMessagesLimit();

if (limit !== null && pinnedCount >= limit) {
Expand All @@ -239,6 +239,50 @@

Both resolve to `null` when the app settings carry no value — show generic copy in that case rather than guessing a number. `getSystemPinnedMessagesLimit()` is the separate cap for admin/global pins, enforced independently of the per-user one.

## Error Handling

`pinMessage()` and `unpinMessage()` reject with a `CometChatException`. Branch on the code rather than the message text:

| Code | Meaning |
| --- | --- |
| `ERR_PERMISSION_DENIED` | The acting user's role may not pin or unpin here (HTTP 403). Pin and unpin are gated independently. |
| `ERR_PINNED_MESSAGES_LIMIT_EXCEEDED` | The conversation's pin cap was reached (HTTP 400). |
| `ERR_MESSAGE_ID_NOT_FOUND` | No message with that id — it never existed, or it was deleted (HTTP 404). |
| `ERR_MESSAGE_NO_ACCESS` | The user has no access to that message — for example they are not a participant in its conversation (HTTP 403). |

<Tabs>
<Tab title="TypeScript">
```typescript
CometChat.pinMessage("1").then(
(response: CometChat.BaseMessage) => {
console.log("Done:", response);
},
(error: CometChat.CometChatException) => {
// e.g. code: "ERR_PINNED_MESSAGES_LIMIT_EXCEEDED"
console.log(error.code, error.message);
}
);
```
</Tab>
<Tab title="JavaScript">
```javascript
CometChat.pinMessage("1").then(
(response) => {
console.log("Done:", response);
},
(error) => {
// e.g. code: "ERR_PINNED_MESSAGES_LIMIT_EXCEEDED"
console.log(error.code, error.message);
}
);
```
</Tab>
</Tabs>

<Note>
Read the cap from `CometChat.getPinnedMessagesLimit()`, which resolves to the configured cap, or `null` when unset — so you can name the exact number in your own copy without parsing it out of the error text.
</Note>

## Feature Availability

Check whether Pin Message is enabled for your app before showing pin actions.
Expand Down
45 changes: 45 additions & 0 deletions sdk/javascript/save-message.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Save A Message"
description: "Save and unsave messages privately, fetch the saved list across conversations, and listen for save events with the CometChat JavaScript SDK."

Check warning on line 3 in sdk/javascript/save-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/save-message.mdx#L3

Did you really mean 'unsave'?
---

Saving bookmarks a message for the logged-in user. Unlike a pin, a save is **private and cross-conversation**: nobody else can see it, no role is required, and the saved list spans every conversation the user is part of.
Expand All @@ -17,7 +17,7 @@
<Tabs>
<Tab title="TypeScript">
```typescript
let messageId: number = 100;

Check warning on line 20 in sdk/javascript/save-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/save-message.mdx#L20

Did you really mean 'messageId'?

CometChat.saveMessage(messageId).then(
(message: CometChat.BaseMessage) => {
Expand All @@ -31,7 +31,7 @@
</Tab>
<Tab title="JavaScript">
```javascript
let messageId = 100;

Check warning on line 34 in sdk/javascript/save-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/save-message.mdx#L34

Did you really mean 'messageId'?

CometChat.saveMessage(messageId).then(
(message) => {
Expand All @@ -47,7 +47,7 @@

Saving is idempotent — saving an already saved message succeeds rather than failing.

## Unsave a Message

Check warning on line 50 in sdk/javascript/save-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/save-message.mdx#L50

Did you really mean 'Unsave'?

<Tabs>
<Tab title="TypeScript">
Expand Down Expand Up @@ -85,7 +85,7 @@
<Tabs>
<Tab title="TypeScript">
```typescript
let messagesRequest: CometChat.MessagesRequest =

Check warning on line 88 in sdk/javascript/save-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/save-message.mdx#L88

Did you really mean 'messagesRequest'?
new CometChat.MessagesRequestBuilder()
.setSaved(true)
.setLimit(50)
Expand All @@ -103,7 +103,7 @@
</Tab>
<Tab title="JavaScript">
```javascript
let messagesRequest = new CometChat.MessagesRequestBuilder()

Check warning on line 106 in sdk/javascript/save-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/save-message.mdx#L106

Did you really mean 'messagesRequest'?
.setSaved(true)
.setLimit(50)
.build();
Expand Down Expand Up @@ -177,7 +177,7 @@

## Real-time Save Events

Save and unsave are **private multi-device** events: they are delivered to the user's other logged-in sessions so a save on the phone shows up on the desktop. Add the callbacks to your existing `MessageListener`.

Check warning on line 180 in sdk/javascript/save-message.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/save-message.mdx#L180

Did you really mean 'unsave'?

<Tabs>
<Tab title="TypeScript">
Expand Down Expand Up @@ -246,6 +246,51 @@

It resolves to `null` when the app settings carry no value — show generic copy in that case rather than guessing a number.

## Error Handling

`saveMessage()` and `unsaveMessage()` reject with a `CometChatException`. Branch on the code rather than the message text:

| Code | Meaning |
| --- | --- |
| `ERR_SAVED_MESSAGES_LIMIT_EXCEEDED` | The user's save cap was reached (HTTP 400). |
| `ERR_MESSAGE_ID_NOT_FOUND` | No message with that id — it never existed, or it was deleted (HTTP 404). |
| `ERR_MESSAGE_NO_ACCESS` | The user has no access to that message — for example they are not a participant in its conversation (HTTP 403). |

Saving is per-user, so there is no role gate: any participant can save a message they have access to, up to the cap.

<Tabs>
<Tab title="TypeScript">
```typescript
CometChat.saveMessage("1").then(
(response: CometChat.BaseMessage) => {
console.log("Done:", response);
},
(error: CometChat.CometChatException) => {
// e.g. code: "ERR_SAVED_MESSAGES_LIMIT_EXCEEDED"
console.log(error.code, error.message);
}
);
```
</Tab>
<Tab title="JavaScript">
```javascript
CometChat.saveMessage("1").then(
(response) => {
console.log("Done:", response);
},
(error) => {
// e.g. code: "ERR_SAVED_MESSAGES_LIMIT_EXCEEDED"
console.log(error.code, error.message);
}
);
```
</Tab>
</Tabs>

<Note>
Read the cap from `CometChat.getSavedMessagesLimit()`, which resolves to the configured cap, or `null` when unset — so you can name the exact number in your own copy without parsing it out of the error text.
</Note>

## Feature Availability

<Tabs>
Expand Down
68 changes: 68 additions & 0 deletions sdk/javascript/thread-subscription.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@

That default is what makes the flag meaningful on your own messages. Since it starts out `true`, a `false` on a message **you sent** — read from a fetch, not the socket — is not silence. It means you unsubscribed, and nothing should quietly put you back.

This only holds for a message you sent and obtained from a fetch. On anyone else's message, or on anything socket-delivered, `false` still just means the server was not asked.

Check warning on line 142 in sdk/javascript/thread-subscription.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/thread-subscription.mdx#L142

Did you really mean 'else's'?

### Keeping your own copies in sync

Expand Down Expand Up @@ -218,7 +218,7 @@
<Tabs>
<Tab title="TypeScript">
```typescript
let threadsRequest: CometChat.ThreadsRequest =

Check warning on line 221 in sdk/javascript/thread-subscription.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/thread-subscription.mdx#L221

Did you really mean 'threadsRequest'?
new CometChat.ThreadsRequestBuilder()
.setParticipatedByMe(true)
.setLimit(30)
Expand All @@ -236,7 +236,7 @@
</Tab>
<Tab title="JavaScript">
```javascript
let threadsRequest = new CometChat.ThreadsRequestBuilder()

Check warning on line 239 in sdk/javascript/thread-subscription.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/thread-subscription.mdx#L239

Did you really mean 'threadsRequest'?
.setParticipatedByMe(true)
.setLimit(30)
.build();
Expand Down Expand Up @@ -307,6 +307,74 @@
message's `sentAt` — a thread with no replies has no last reply.
</Note>

## Notification Preferences

The notification preference for replies carries a value that pairs with this feature, so a user can be notified only about the threads they follow: `SUBSCRIBE_TO_SUBSCRIBED_THREADS` in the `RepliesOptions` enum.

| Value | Behavior |
| --- | --- |
| `DONT_SUBSCRIBE` | No notifications for thread replies. |
| `SUBSCRIBE_TO_ALL` | Notifications for all thread replies. |
| `SUBSCRIBE_TO_MENTIONS` | Notifications only for replies that mention the user. |
| `SUBSCRIBE_TO_SUBSCRIBED_THREADS` | Notifications for replies in threads the user is subscribed to. |

Threads exist in one-on-one conversations as well as groups, so set it on whichever preferences you are updating:

<Tabs>
<Tab title="TypeScript">
```typescript
const updatedPreferences = new CometChatNotifications.NotificationPreferences();

Check warning on line 326 in sdk/javascript/thread-subscription.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/thread-subscription.mdx#L326

Did you really mean 'updatedPreferences'?

const groupPreferences = new CometChatNotifications.GroupPreferences();
groupPreferences.setRepliesPreference(
CometChatNotifications.RepliesOptions.SUBSCRIBE_TO_SUBSCRIBED_THREADS
);
updatedPreferences.setGroupPreferences(groupPreferences);

const oneOnOnePreferences = new CometChatNotifications.OneOnOnePreferences();
oneOnOnePreferences.setRepliesPreference(
CometChatNotifications.RepliesOptions.SUBSCRIBE_TO_SUBSCRIBED_THREADS
);
updatedPreferences.setOneOnOnePreferences(oneOnOnePreferences);

const preferences = await CometChatNotifications.updatePreferences(
updatedPreferences
);
```
</Tab>
<Tab title="JavaScript">
```javascript
const updatedPreferences = new CometChatNotifications.NotificationPreferences();

Check warning on line 347 in sdk/javascript/thread-subscription.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/thread-subscription.mdx#L347

Did you really mean 'updatedPreferences'?

const groupPreferences = new CometChatNotifications.GroupPreferences();
groupPreferences.setRepliesPreference(
CometChatNotifications.RepliesOptions.SUBSCRIBE_TO_SUBSCRIBED_THREADS
);
updatedPreferences.setGroupPreferences(groupPreferences);

const oneOnOnePreferences = new CometChatNotifications.OneOnOnePreferences();
oneOnOnePreferences.setRepliesPreference(
CometChatNotifications.RepliesOptions.SUBSCRIBE_TO_SUBSCRIBED_THREADS
);
updatedPreferences.setOneOnOnePreferences(oneOnOnePreferences);

const preferences = await CometChatNotifications.updatePreferences(
updatedPreferences
);
```
</Tab>
</Tabs>

<Note>
`updatePreferences()` merges what you set, so sending only the fields you changed is enough.
</Note>

<Warning>
A **threaded reply** (a message posted into a thread) and a **quoted reply** (a reply to one specific message) are configured through two different enums — `RepliesOptions` and `QuotedRepliesOptions` — and their fourth values differ, so the raw number `4` means something different on each. Pass a `QuotedRepliesOptions` value to `setQuotedRepliesPreference()`, never a `RepliesOptions` one.

Check warning on line 373 in sdk/javascript/thread-subscription.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/javascript/thread-subscription.mdx#L373

Did you really mean 'enums'?
</Warning>

See [Notification Preferences](/notifications/preferences) for reading and updating a user's preferences, and for the full `QuotedRepliesOptions` list.

## Error Handling

Both `subscribeToThread()` and `unsubscribeFromThread()` reject with a `CometChatException`. The most common client-side failure is an invalid parent message ID.
Expand Down
2 changes: 1 addition & 1 deletion ui-kit/react/components/conversations.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Conversations"
description: "Scrollable list of recent one-on-one and group conversations for the logged-in user with real-time updates."

Check warning on line 3 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L3

Did you really mean 'Scrollable'?
---

<Accordion title="AI Integration Quick Reference">
Expand Down Expand Up @@ -47,7 +47,7 @@
"onSearchBarClicked": "() => void"
},
"visibility": {
"hideReceipts": { "type": "boolean", "default": false },

Check warning on line 50 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L50

Did you really mean 'hideReceipts'?
"hideUserStatus": { "type": "boolean", "default": false },
"hideGroupType": { "type": "boolean", "default": false },
"hideUnreadCount": { "type": "boolean", "default": false },
Expand All @@ -61,7 +61,7 @@
"customSoundForMessages": { "type": "string", "default": "built-in" }
},
"selection": {
"selectionMode": {

Check warning on line 64 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L64

Did you really mean 'selectionMode'?
"type": "CometChatConversationsSelectionMode",
"values": ["'none'", "'single'", "'multiple'"],
"default": "'none'"
Expand Down Expand Up @@ -222,7 +222,7 @@
function ChatApp() {
const [user, setUser] = useState<CometChat.User | undefined>();
const [group, setGroup] = useState<CometChat.Group | undefined>();
const [activeConversation, setActiveConversation] = useState<CometChat.Conversation | undefined>();

Check warning on line 225 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L225

Did you really mean 'activeConversation'?

const handleConversationClick = (conversation: CometChat.Conversation) => {
setActiveConversation(conversation); // highlights the open row in the list
Expand Down Expand Up @@ -310,9 +310,9 @@
| Prop | Signature | Fires when |
| --- | --- | --- |
| `onItemClick` | `(conversation: CometChat.Conversation) => void` | User clicks a conversation item |
| `onSelect` | `(conversation: CometChat.Conversation, selected: boolean) => void` | Conversation selected/deselected (selection mode) |

Check warning on line 313 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L313

Did you really mean 'onSelect'?
| `onError` | `((error: CometChat.CometChatException) => void) \| null` | SDK error occurs |

Check warning on line 314 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L314

Did you really mean 'onError'?
| `onEmpty` | `() => void` | List is empty after initial fetch |

Check warning on line 315 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L315

Did you really mean 'onEmpty'?
| `onSearchBarClicked` | `() => void` | Search bar is clicked (makes input read-only) |

### Events Emitted
Expand Down Expand Up @@ -364,7 +364,7 @@

When pinning is enabled for your app (the `features.ux.conversations.pinned.enabled` app setting), each row's context menu carries a **Pin / Unpin** action, and pinned chats sort to the top of the list with a pin indicator on the row. This is wired out of the box — no props required.

Pins are personal to each user, and your app can cap how many a user may pin through the `features.ux.conversations.pinned.limit` app setting; when a user reaches the cap, the kit shows a toast naming the limit. To remove the menu action entirely, set [`hidePinConversation`](#hidepinconversation). See [Core Features → Pin & Save](/ui-kit/react/core-features#pin-and-save-messages).
Pins are personal to each user, and your app can cap how many a user may pin through the `features.ux.conversations.pinned.limit` app setting; when a user reaches the cap, the kit shows a toast naming the limit. To remove the menu action entirely, set [`hidePinConversation`](#hidepinconversation). See [Core Features → Pin Conversations](/ui-kit/react/core-features#pin-conversations).

A conversation can also be **system-pinned** app-wide (even when empty). System pins always sort above user pins and cannot be unpinned from the UI.

Expand All @@ -374,8 +374,8 @@

```tsx
<CometChatConversations
headerView={<MyCustomHeader />}

Check warning on line 377 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L377

Did you really mean 'headerView'?
itemView={(conversation) => <MyCustomItem conversation={conversation} />}

Check warning on line 378 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L378

Did you really mean 'itemView'?
emptyView={<EmptyState />}
loadingView={<Skeleton />}
errorView={<ErrorBanner />}
Expand All @@ -385,10 +385,10 @@
| Slot | Signature | Replaces |
| --- | --- | --- |
| `itemView` | `(conversation) => ReactNode` | Entire conversation row |
| `leadingView` | `(conversation) => ReactNode` | Avatar section |

Check warning on line 388 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L388

Did you really mean 'leadingView'?
| `titleView` | `(conversation) => ReactNode` | Conversation name |

Check warning on line 389 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L389

Did you really mean 'titleView'?
| `subtitleView` | `(conversation) => ReactNode` | Last message preview |

Check warning on line 390 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L390

Did you really mean 'subtitleView'?
| `trailingView` | `(conversation) => ReactNode` | Timestamp + unread badge |

Check warning on line 391 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L391

Did you really mean 'trailingView'?
| `headerView` | `ReactNode` | Header area |
| `searchView` | `ReactNode` | Search bar |
| `loadingView` | `ReactNode` | Loading shimmer |
Expand Down Expand Up @@ -705,7 +705,7 @@

let className = "conversations__trailing-view-min";
let topLabel = `${diffInMinutes}`;
let bottomLabel = diffInMinutes === 1 ? "Min ago" : "Mins ago";

Check warning on line 708 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L708

Did you really mean 'bottomLabel'?

Check warning on line 708 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L708

Did you really mean 'Mins'?

if (diffInHours >= 1 && diffInHours <= 10) {
className = "conversations__trailing-view-hour";
Expand Down Expand Up @@ -924,7 +924,7 @@
| Sub-component | Description | Props | Flat API equivalent |
| --- | --- | --- | --- |
| `Root` | Context provider and container | All Root props + `children` | — |
| `List` | Scrollable conversation list | `itemView`, `className` | `itemView` |

Check warning on line 927 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L927

Did you really mean 'Scrollable'?
| `Item` | Individual conversation row | `leadingView`, `titleView`, `subtitleView`, `trailingView`, `className` | Per-item view props |
| `Header` | Header area | `title`, `children` | `headerView` |
| `SearchBar` | Search input | `placeholder`, `onClick` | `searchView` |
Expand Down Expand Up @@ -981,7 +981,7 @@

---

### searchKeyword

Check warning on line 984 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L984

Did you really mean 'searchKeyword'?

Initial search keyword to pre-filter conversations on mount.

Expand Down Expand Up @@ -1095,9 +1095,9 @@

---

### showScrollbar

Check warning on line 1098 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L1098

Did you really mean 'showScrollbar'?

Show the native scrollbar on the conversation list.

Check warning on line 1100 in ui-kit/react/components/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/conversations.mdx#L1100

Did you really mean 'scrollbar'?

| | |
| --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion ui-kit/react/components/pinned-messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
</Note>

<Note>
**Permissions & limits** — the unpin action is shown to every member; permission is enforced by the **server**, and a rejected unpin surfaces a permission toast (localizable via `action_permission_denied`). If your app caps pins per conversation, hitting the cap shows a toast naming the limit — you don't handle the error yourself. See the [Pin & Save Messages guide](/ui-kit/react/guide-pin-and-save-messages#step-5-limits).
**Permissions & limits** — the unpin action is shown to every member; permission is enforced by the **server**, and a rejected unpin surfaces a permission toast (localizable via `action_permission_denied`). If your app caps pins per conversation, hitting the cap shows a toast naming the limit — you don't handle the error yourself. See the [Pin & Save Messages guide](/ui-kit/react/guide-pin-and-save-messages#step-5-app-settings-and-limits).
</Note>

---
Expand All @@ -140,7 +140,7 @@

function PinnedPanel({
group,
onClose,

Check warning on line 143 in ui-kit/react/components/pinned-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/pinned-messages.mdx#L143

Did you really mean 'onClose'?
}: {
group: CometChat.Group;
onClose: () => void;
Expand Down Expand Up @@ -366,9 +366,9 @@

---

### textFormatters

Check warning on line 369 in ui-kit/react/components/pinned-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/pinned-messages.mdx#L369

Did you really mean 'textFormatters'?

Text formatters applied when rendering the pinned message previews. See [Text Formatters](/ui-kit/react/plugins/text-formatters).

Check warning on line 371 in ui-kit/react/components/pinned-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/pinned-messages.mdx#L371

Did you really mean 'formatters'?

| | |
| --- | --- |
Expand Down Expand Up @@ -401,7 +401,7 @@

### hideSaveMessageOption / hideUnsaveMessageOption

Remove the save / unsave actions from the per-message options.

Check warning on line 404 in ui-kit/react/components/pinned-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/pinned-messages.mdx#L404

Did you really mean 'unsave'?

| | |
| --- | --- |
Expand Down Expand Up @@ -487,7 +487,7 @@

---

### className

Check warning on line 490 in ui-kit/react/components/pinned-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/pinned-messages.mdx#L490

Did you really mean 'className'?

Additional CSS class for the root element.

Expand Down
2 changes: 1 addition & 1 deletion ui-kit/react/components/saved-messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</Note>

<Note>
**Limit** — if your app caps how many messages a user can save, hitting the cap shows a toast naming the limit; you don't handle the error yourself. See the [Pin & Save Messages guide](/ui-kit/react/guide-pin-and-save-messages#step-5-limits).
**Limit** — if your app caps how many messages a user can save, hitting the cap shows a toast naming the limit; you don't handle the error yourself. See the [Pin & Save Messages guide](/ui-kit/react/guide-pin-and-save-messages#step-5-app-settings-and-limits).
</Note>

---
Expand All @@ -112,7 +112,7 @@
```tsx
import { CometChatSavedMessages } from "@cometchat/chat-uikit-react";

function SavedScreen({ onClose }: { onClose: () => void }) {

Check warning on line 115 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L115

Did you really mean 'onClose'?
return <CometChatSavedMessages onClose={onClose} />;
}
```
Expand Down Expand Up @@ -189,13 +189,13 @@

### Events

The component itself publishes nothing, but the unsave action it renders (through the shared message options) publishes `ui:message/save-changed`, which keeps other surfaces in sync.

Check warning on line 192 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L192

Did you really mean 'unsave'?

It subscribes to the kit event bus and updates its list automatically — an optimistic `ui:` flip the moment a save/unsave succeeds locally, then the network-confirmed SDK event:

| Event | Payload | Behavior |
| --- | --- | --- |
| `ui:message/save-changed` | `{ message, saved }` | Optimistic: adds on save, removes on unsave |

Check warning on line 198 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L198

Did you really mean 'unsave'?
| `message/saved` / `message/unsaved` | `{ message }` | Network-confirmed add / remove |

See the [Event System](/ui-kit/react/event-system#pin-and-save) for the full list.
Expand All @@ -206,14 +206,14 @@

### Per-message Options

Each saved row exposes an unsave action. Hide it with `hideUnsaveMessageOption`:

Check warning on line 209 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L209

Did you really mean 'unsave'?

```tsx
<CometChatSavedMessages hideUnsaveMessageOption />
```

<Note>
Saved rows are list items rather than full message bubbles, so they carry only the unsave action — there is no full per-message options menu here.

Check warning on line 216 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L216

Did you really mean 'unsave'?
</Note>

### View Props
Expand Down Expand Up @@ -283,9 +283,9 @@

---

### textFormatters

Check warning on line 286 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L286

Did you really mean 'textFormatters'?

Text formatters applied when rendering the saved message previews. See [Text Formatters](/ui-kit/react/plugins/text-formatters).

Check warning on line 288 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L288

Did you really mean 'formatters'?

| | |
| --- | --- |
Expand All @@ -307,7 +307,7 @@

### hideUnsaveMessageOption

Remove the unsave action from each saved row.

Check warning on line 310 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L310

Did you really mean 'unsave'?

| | |
| --- | --- |
Expand Down Expand Up @@ -338,7 +338,7 @@

---

### className

Check warning on line 341 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L341

Did you really mean 'className'?

Additional CSS class for the root element.

Expand All @@ -363,7 +363,7 @@
| Row preview | `.cometchat-saved-messages__item-preview` |
| Row subtitle | `.cometchat-saved-messages__item-subtitle` |
| Row media-type icon | `.cometchat-saved-messages__item-subtitle-icon` (`--image`, `--video`, `--audio`, `--file`) |
| Row unsave button | `.cometchat-saved-messages__item-unsave` |

Check warning on line 366 in ui-kit/react/components/saved-messages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/react/components/saved-messages.mdx#L366

Did you really mean 'unsave'?
| Empty state | `.cometchat-saved-messages__empty` |
| Empty title | `.cometchat-saved-messages__empty-title` |
| Empty subtitle | `.cometchat-saved-messages__empty-subtitle` |
Expand Down
38 changes: 34 additions & 4 deletions ui-kit/react/core-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ Threads require wiring: capture the parent message from the Message List's `onTh
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [Threaded Messages guide](/ui-kit/react/guide-threaded-messages) | The [Threaded Messages guide](/ui-kit/react/guide-threaded-messages) shows how to build a thread panel: `onThreadRepliesClick`, `parentMessageId`, and `CometChatThreadHeader` (which displays the parent message with its reply count). |

### Thread Subscription

Users can **subscribe** to a thread to keep getting updates about its replies even when they aren't viewing it, and unsubscribe to stop. Subscription is per-user and per-thread, works in both 1:1 and group conversations, and is wired out of the box — there is no flag to turn on.

| Components | Functionality |
| --- | --- |
| [Message List](/ui-kit/react/components/message-list#hidethreadsubscriptionoption) | Adds a Subscribe / Unsubscribe option to the message options menu. On a reply, the action targets the thread's parent message. |
| [Thread Header](/ui-kit/react/components/thread-header#thread-subscription) | Shows a subscription bell on the thread panel that reflects and toggles the current state. |

Subscriptions are also created automatically by the **server**, so they apply to any app on the SDK, not just the UI Kit: sending a message subscribes you to that message's own thread, posting a reply subscribes you to that thread, and being @mentioned in a reply subscribes you. The kit reflects these the moment they happen. A deliberate unsubscribe is remembered. See the [Threaded Messages guide](/ui-kit/react/guide-threaded-messages#thread-subscription) for the full behaviour, the `hide*` props, and the `useThreadSubscription` hook.

## Quoted Replies

Quoted Replies is a robust feature provided by CometChat that enables users to quickly reply to specific messages by selecting the "Reply" option from a message's action menu. This enhances context, keeps conversations organized, and improves overall chat experience in both 1-1 and group chats.
Expand Down Expand Up @@ -195,19 +206,38 @@ CometChat lets users **pin** important messages so they're highlighted for every
| Components | Functionality |
| --- | --- |
| [Message List](/ui-kit/react/components/message-list#pin-and-save-options) | Adds Pin, Unpin, Save, and Unsave to the message options menu when the features are enabled. |
| [Message Bubble](/ui-kit/react/components/message-bubble#pinned-and-saved-indicators) | Marks pinned and saved messages with an indicator on the bubble. |
| [Message Header](/ui-kit/react/components/message-header) | Provides the "Pinned messages" entry point in its overflow menu. |
| [Pinned Messages](/ui-kit/react/components/pinned-messages) | A panel of the messages pinned in a conversation, opened from the [Message Header](/ui-kit/react/components/message-header). |
| [Saved Messages](/ui-kit/react/components/saved-messages) | A personal screen of the current user's saved messages across all conversations. |
| [Conversations](/ui-kit/react/components/conversations#hidepinconversation) | Lets users pin a whole conversation to the top of their list. |

Your app can also cap how many items a user may pin or save through three app settings:
Each feature is switched on per app, and each carries its own cap:

| App setting | Caps |
| App setting | Controls |
| --- | --- |
| features.ux.messages.pinned.enabled | Whether the pin options and panel render at all |
| features.ux.messages.pinned.limit | Pinned messages per conversation |
| features.ux.messages.saved.enabled | Whether the save options and screen render at all |
| features.ux.messages.saved.limit | Saved messages per user |

The UI Kit reads these settings at login, so no wiring is needed to show, hide, or enforce them. When a user reaches a cap, the kit shows a toast that names the exact limit — no extra handling required. For a full walkthrough, see the [Pin & Save Messages guide](/ui-kit/react/guide-pin-and-save-messages).

## Pin Conversations

Keep the chats that matter at the top. Users pin a conversation from the row's context menu; pinned conversations show a pin indicator and sort above the rest of the list. Pins are personal to each user.

| Components | Functionality |
| --- | --- |
| [Conversations](/ui-kit/react/components/conversations#pin-conversation) | Provides the Pin / Unpin conversation option, the row indicator, and pinned-first ordering. |

Conversation pinning is switched on per app, and carries its own cap:

| App setting | Controls |
| --- | --- |
| features.ux.conversations.pinned.enabled | Whether the pin/unpin conversation option renders |
| features.ux.conversations.pinned.limit | Pinned conversations per user |

The UI Kit reads these settings at login. When a user reaches a cap, the kit shows a toast that names the exact limit — no extra handling required. For a full walkthrough, see the [Pin & Save Messages guide](/ui-kit/react/guide-pin-and-save-messages).
A conversation can also be **system-pinned** app-wide by your app. System pins always sort above user pins and cannot be unpinned from the UI. See [Conversations → Pin Conversation](/ui-kit/react/components/conversations#pin-conversation).

## Group Chat

Expand Down
Loading
Loading