@cometchat/skills 4.2.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +33 -12
- package/bin/install.js +59 -4
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +460 -77
- package/skills/cometchat/references/asking-questions.md +48 -0
- package/skills/cometchat-a11y/SKILL.md +3 -2
- package/skills/cometchat-android-v5/SKILL.md +2 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
- package/skills/cometchat-android-v5-calls/references/README.md +1 -1
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
- package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
- package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
- package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
- package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
- package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
- package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
- package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
- package/skills/cometchat-android-v5-components/SKILL.md +4 -3
- package/skills/cometchat-android-v5-core/SKILL.md +20 -2
- package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
- package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
- package/skills/cometchat-android-v5-features/SKILL.md +5 -4
- package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
- package/skills/cometchat-android-v5-production/SKILL.md +2 -1
- package/skills/cometchat-android-v5-push/SKILL.md +2 -3
- package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
- package/skills/cometchat-android-v6/SKILL.md +2 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
- package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
- package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
- package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
- package/skills/cometchat-android-v6-core/SKILL.md +389 -9
- package/skills/cometchat-android-v6-events/SKILL.md +4 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
- package/skills/cometchat-android-v6-features/SKILL.md +26 -2
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
- package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
- package/skills/cometchat-android-v6-production/SKILL.md +6 -3
- package/skills/cometchat-android-v6-push/SKILL.md +43 -2
- package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
- package/skills/cometchat-angular-calls/SKILL.md +256 -389
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
- package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
- package/skills/cometchat-angular-calls/references/call-session.md +2 -2
- package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
- package/skills/cometchat-angular-calls/references/device-management.md +53 -34
- package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
- package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
- package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
- package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
- package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
- package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
- package/skills/cometchat-angular-components/SKILL.md +149 -620
- package/skills/cometchat-angular-core/SKILL.md +235 -293
- package/skills/cometchat-angular-customization/SKILL.md +415 -223
- package/skills/cometchat-angular-features/SKILL.md +216 -334
- package/skills/cometchat-angular-patterns/SKILL.md +168 -359
- package/skills/cometchat-angular-placement/SKILL.md +189 -560
- package/skills/cometchat-angular-production/SKILL.md +241 -92
- package/skills/cometchat-angular-push/SKILL.md +280 -294
- package/skills/cometchat-angular-testing/SKILL.md +430 -158
- package/skills/cometchat-angular-theming/SKILL.md +190 -265
- package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
- package/skills/cometchat-astro-patterns/SKILL.md +22 -1
- package/skills/cometchat-calls/SKILL.md +25 -19
- package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
- package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
- package/skills/cometchat-calls/references/use-case-support.md +3 -4
- package/skills/cometchat-calls/references/use-case-team.md +23 -12
- package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
- package/skills/cometchat-components/SKILL.md +163 -25
- package/skills/cometchat-core/SKILL.md +412 -13
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +313 -34
- package/skills/cometchat-flutter-v5/SKILL.md +10 -4
- package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +20 -2
- package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
- package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
- package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
- package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6/SKILL.md +17 -16
- package/skills/cometchat-flutter-v6-calls/SKILL.md +78 -63
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +8 -6
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
- package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
- package/skills/cometchat-flutter-v6-core/SKILL.md +348 -10
- package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
- package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
- package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
- package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
- package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
- package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
- package/skills/cometchat-flutter-v6-push/SKILL.md +43 -21
- package/skills/cometchat-flutter-v6-testing/SKILL.md +6 -6
- package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
- package/skills/cometchat-i18n/SKILL.md +139 -78
- package/skills/cometchat-ios/SKILL.md +4 -2
- package/skills/cometchat-ios-calls/SKILL.md +225 -95
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
- package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
- package/skills/cometchat-ios-calls/references/call-session.md +51 -54
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
- package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
- package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
- package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
- package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
- package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
- package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
- package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
- package/skills/cometchat-ios-components/SKILL.md +200 -12
- package/skills/cometchat-ios-core/SKILL.md +281 -11
- package/skills/cometchat-ios-customization/SKILL.md +276 -110
- package/skills/cometchat-ios-features/SKILL.md +64 -36
- package/skills/cometchat-ios-placement/SKILL.md +15 -12
- package/skills/cometchat-ios-production/SKILL.md +12 -4
- package/skills/cometchat-ios-push/SKILL.md +53 -19
- package/skills/cometchat-ios-testing/SKILL.md +14 -9
- package/skills/cometchat-ios-theming/SKILL.md +39 -3
- package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
- package/skills/cometchat-native-bare-patterns/SKILL.md +56 -18
- package/skills/cometchat-native-calls/SKILL.md +89 -19
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
- package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
- package/skills/cometchat-native-calls/references/call-session.md +2 -2
- package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
- package/skills/cometchat-native-calls/references/device-management.md +53 -30
- package/skills/cometchat-native-calls/references/group-calls.md +35 -30
- package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
- package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
- package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
- package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
- package/skills/cometchat-native-calls/references/share-invite.md +7 -5
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
- package/skills/cometchat-native-components/SKILL.md +91 -57
- package/skills/cometchat-native-core/SKILL.md +281 -9
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +77 -27
- package/skills/cometchat-native-features/SKILL.md +79 -49
- package/skills/cometchat-native-placement/SKILL.md +19 -10
- package/skills/cometchat-native-production/SKILL.md +9 -3
- package/skills/cometchat-native-push/SKILL.md +2 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -2
- package/skills/cometchat-native-theming/SKILL.md +54 -29
- package/skills/cometchat-native-troubleshooting/SKILL.md +71 -3
- package/skills/cometchat-nextjs-patterns/SKILL.md +48 -6
- package/skills/cometchat-placement/SKILL.md +42 -3
- package/skills/cometchat-production/SKILL.md +12 -5
- package/skills/cometchat-react-calls/SKILL.md +220 -10
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
- package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
- package/skills/cometchat-react-calls/references/call-session.md +1 -1
- package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
- package/skills/cometchat-react-calls/references/device-management.md +55 -51
- package/skills/cometchat-react-calls/references/group-calls.md +18 -23
- package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
- package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
- package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
- package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
- package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
- package/skills/cometchat-react-calls/references/share-invite.md +4 -5
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
- package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
- package/skills/cometchat-react-patterns/SKILL.md +57 -4
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +43 -4
- package/skills/cometchat-react-testing/SKILL.md +14 -5
- package/skills/cometchat-theming/SKILL.md +181 -18
- package/skills/cometchat-troubleshooting/SKILL.md +40 -20
|
@@ -3,13 +3,14 @@ name: cometchat-customization
|
|
|
3
3
|
description: Customize a CometChat React UI Kit integration beyond what `cometchat init` and `cometchat apply-feature` produce — custom message bubbles, custom header views, custom subtitle views, custom empty/loading states, custom action menus, request builder filters, event listeners, and component composition. Picks up where the framework skills end (after Phase A init succeeds).
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Node.js >=18; @cometchat/chat-uikit-react ^6"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list, grep"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat react customization custom-view message-bubble header-view subtitle-view request-builder events"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** the per-platform UI Kit customization systems (theme objects / CSS vars, message templates, text formatters) verified against the installed kit. (Official docs linked below.) Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
13
14
|
> **Companion skills:** `cometchat-components` provides the component
|
|
14
15
|
> catalog (what exists); this skill provides the customization workflow
|
|
15
16
|
> (how to modify what exists). Use `cometchat-components` to look up
|
|
@@ -41,8 +42,8 @@ Trigger phrases:
|
|
|
41
42
|
- The user wants to enable a **packaged feature** (calls, polls, AI smart
|
|
42
43
|
replies, etc.) → use `cometchat-features` instead
|
|
43
44
|
- The user wants to change **theme tokens** (primary color, font,
|
|
44
|
-
border radius) → use `cometchat-theming` instead
|
|
45
|
-
|
|
45
|
+
border radius) → use `cometchat-theming` instead (CSS-variable
|
|
46
|
+
overrides written directly into the project — there is no theming CLI)
|
|
46
47
|
- The user wants to **start a new integration** → use the `cometchat`
|
|
47
48
|
dispatcher skill to run Phase A first
|
|
48
49
|
- The user wants to **fix something broken** → use
|
|
@@ -56,13 +57,19 @@ event topic, CSS selector) that lives in the canonical CometChat docs,
|
|
|
56
57
|
not in this skill's text. Embedding examples here would create drift
|
|
57
58
|
the moment the SDK changes.
|
|
58
59
|
|
|
59
|
-
The CometChat docs
|
|
60
|
-
|
|
60
|
+
The canonical CometChat docs are the source of truth for this skill. The
|
|
61
|
+
docs MCP at `cometchat-docs` is the **best** way to query them when
|
|
62
|
+
available, but it is **not** a hard requirement — fall back to the public
|
|
63
|
+
docs site for any agent without it. The docs cover:
|
|
61
64
|
|
|
62
65
|
- Component prop tables (every component, every prop, every default)
|
|
63
66
|
- Custom view slots: `headerView`, `subtitleView`, `tailView`,
|
|
64
|
-
`optionsView`, `bubbleView`, `
|
|
65
|
-
|
|
67
|
+
`optionsView`, `bubbleView`, `emptyView`, `loadingView`, `errorView`
|
|
68
|
+
(which components support which slots — verified against the v6 React
|
|
69
|
+
kit: the list components `CometChatConversations`/`MessageList`/`Users`/
|
|
70
|
+
`Groups` use `emptyView`/`loadingView`/`errorView`, **not** the
|
|
71
|
+
`*StateView` form; only `CometChatNotificationFeed` uses
|
|
72
|
+
`emptyStateView`/`loadingStateView`/`errorStateView`)
|
|
66
73
|
- Message template overrides (`CometChatMessageTemplate.type`,
|
|
67
74
|
`category`, `contentView`, `headerView`, `footerView`)
|
|
68
75
|
- Request builders for filtering data: `ConversationsRequestBuilder`,
|
|
@@ -77,21 +84,30 @@ for this skill. It's the source of truth for:
|
|
|
77
84
|
|
|
78
85
|
**Hard rules:**
|
|
79
86
|
|
|
80
|
-
1. **
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
1. **Look up the docs before generating any customization code.** Never
|
|
88
|
+
invent prop names, builder methods, event topics, or CSS classes from
|
|
89
|
+
training-data memory. Use whichever lookup path is available, in order:
|
|
90
|
+
- **(a) docs MCP** — query the `cometchat-docs` MCP tool if your agent
|
|
91
|
+
has it. Richest path.
|
|
92
|
+
- **(b) install the MCP, if your agent supports it** — Claude Code:
|
|
93
|
+
`claude mcp add --transport http cometchat-docs
|
|
94
|
+
https://www.cometchat.com/docs/mcp`. Other agents (Cursor, Codex,
|
|
95
|
+
Cline, …) configure MCP their own way, or not at all — do NOT block.
|
|
96
|
+
- **(c) fetch/search the public docs** — same content at the canonical
|
|
97
|
+
URLs below, or web-search `site:cometchat.com/docs`. Universal
|
|
98
|
+
fallback; never STOP and dead-end the user when the MCP isn't
|
|
99
|
+
installed — fall through to (c).
|
|
88
100
|
3. **Prefer composition (custom view props) over CSS overrides** when
|
|
89
101
|
both are options — composition is more stable across SDK versions.
|
|
90
102
|
4. **Canonical reference URLs:**
|
|
91
103
|
- Components overview: https://www.cometchat.com/docs/ui-kit/react/components-overview
|
|
104
|
+
- Guides index: https://www.cometchat.com/docs/ui-kit/react/guide-overview — the 7 maintained task recipes (prefer these over hand-rolling): [Block/Unblock](https://www.cometchat.com/docs/ui-kit/react/guide-block-unblock-user) · [Call Log Details](https://www.cometchat.com/docs/ui-kit/react/guide-call-log-details) · [Group Management](https://www.cometchat.com/docs/ui-kit/react/guide-group-chat) · [Message Privately](https://www.cometchat.com/docs/ui-kit/react/guide-message-privately) · [New Chat](https://www.cometchat.com/docs/ui-kit/react/guide-new-chat) · [Search Messages](https://www.cometchat.com/docs/ui-kit/react/guide-search-messages) · [Threaded Messages](https://www.cometchat.com/docs/ui-kit/react/guide-threaded-messages)
|
|
105
|
+
- **Custom message recipes** (verified, copy-ready): custom message TYPES, overriding an existing type's bubble (`bubbleView`/`contentView`), adding a Message Composer attachment option, and adding a message action like Forward — all live in **`cometchat-features` §Type 5** (append-not-replace via `CometChatUIKit.getDataSource()`). Route there for the actual code; this skill covers the custom-VIEW-slot props.
|
|
92
106
|
- Theming + styling: https://www.cometchat.com/docs/ui-kit/react/theme
|
|
93
107
|
- Events: https://www.cometchat.com/docs/ui-kit/react/events
|
|
94
108
|
- Methods: https://www.cometchat.com/docs/ui-kit/react/methods
|
|
109
|
+
- **Text formatters** (inline mention/URL/markdown/custom-token styling — `CometChatTextFormatter`): the four formatter guides `custom-text-formatter-guide`, `mentions-formatter-guide`, `url-formatter-guide`, `shortcut-formatter-guide` under `ui-kit/react/`. Recipe + the append-not-replace `getAllTextFormatters({})` pattern live in **`cometchat-features` §Type 5 → Text formatters**.
|
|
110
|
+
- **Localization** (languages, custom strings, date/time formatting): handled by the dedicated **`cometchat-i18n`** skill (`CometChatLocalize`) — route there for any locale/string work; docs https://www.cometchat.com/docs/ui-kit/react/localize
|
|
95
111
|
|
|
96
112
|
## Steps
|
|
97
113
|
|
|
@@ -188,9 +204,9 @@ prop, not a new component or custom code.
|
|
|
188
204
|
| Filter conversations | `conversationsRequestBuilder` on `CometChatConversations` |
|
|
189
205
|
| Filter messages | `messagesRequestBuilder` on `CometChatMessageList` |
|
|
190
206
|
| Filter users / groups | `usersRequestBuilder` / `groupsRequestBuilder` |
|
|
191
|
-
| Custom empty state | `
|
|
192
|
-
| Custom error UI | `errorStateView` |
|
|
193
|
-
| Custom loading UI | `loadingStateView` |
|
|
207
|
+
| Custom empty state | `emptyView` on the list components (`Conversations`/`MessageList`/`Users`/`Groups`); `emptyStateView` only on `CometChatNotificationFeed` |
|
|
208
|
+
| Custom error UI | `errorView` (list components); `errorStateView` on `CometChatNotificationFeed` |
|
|
209
|
+
| Custom loading UI | `loadingView` (list components); `loadingStateView` on `CometChatNotificationFeed` |
|
|
194
210
|
| Custom header above the list | `headerView` |
|
|
195
211
|
| Custom message bubble | `templates` prop on `CometChatMessageList` (not a custom bubble component) |
|
|
196
212
|
| Click handler on item / message / search bar / back button | `onItemClick`, `onMessageClick`, `onBack`, `onSearchBarClicked` |
|
|
@@ -231,6 +247,8 @@ If 2a turns up nothing, proceed to 2b.
|
|
|
231
247
|
| Reactions on messages | Already built into `CometChatMessageList` — check if it's just disabled |
|
|
232
248
|
| Message bubble customization | Use the `templates` prop on `CometChatMessageList`, not a custom bubble component |
|
|
233
249
|
|
|
250
|
+
> ⚠️ **Not every row above is a kit export.** `CometChatAddMembers`, `CometChatTransferOwnership`, `CometChatBannedMembers`, `CometChatBlockedUsers`, `CometChatNewChat`, `CometChatCreateGroup`, and `CometChatDetails` are **sample-app components, NOT `@cometchat/chat-uikit-react` v6 exports** — importing `<CometChatTransferOwnership/>` etc. is an unresolved-import build error. Build these by copying the sample-app implementation (§2d), do not import them from the package. The genuinely package-exported entries in this table are: `CometChatThreadHeader`, `CometChatGroupMembers`, `CometChatMentionsFormatter`, `CometChatCallButtons`, `CometChatOutgoingCall`, `CometChatIncomingCall`, `CometChatOngoingCall`, `CometChatCallLogs`. **Always grep the installed package's exports (next step) before emitting any of these.**
|
|
251
|
+
|
|
234
252
|
**Search strategies, in this order:**
|
|
235
253
|
|
|
236
254
|
1. **Query the docs MCP** with the user's intent in plain English.
|
|
@@ -393,13 +411,15 @@ right approach is different per bucket:
|
|
|
393
411
|
|
|
394
412
|
| Bucket | Examples | Approach |
|
|
395
413
|
|---|---|---|
|
|
396
|
-
| **A. Custom view slot** | "add a custom header above the conversation list", "show a custom empty state", "render messages with my own bubble" | Use the corresponding `*View` prop (`headerView`, `
|
|
414
|
+
| **A. Custom view slot** | "add a custom header above the conversation list", "show a custom empty state", "render messages with my own bubble" | Use the corresponding `*View` prop (`headerView`, `emptyView`, `bubbleView`, etc.) — look up which prop the target component supports (list components use `emptyView`/`loadingView`/`errorView`; `CometChatNotificationFeed` uses the `*StateView` form) |
|
|
397
415
|
| **B. Filter / pagination** | "only show conversations with VIP users", "load 10 messages at a time", "show only joined groups" | Use the corresponding RequestBuilder (`ConversationsRequestBuilder.setTags`, `setLimit`, `setUserAndGroupTags`, etc.) — query the MCP for the builder methods |
|
|
398
416
|
| **C. Action / callback** | "do X when a user clicks a conversation", "intercept message send", "log every search" | Use the corresponding `on*` callback prop (`onItemClick`, `onSendButtonClick`, `onSearch`, etc.) — query the MCP for the callback signature |
|
|
399
417
|
| **D. Event subscription** | "show a toast when a new message arrives", "update my unread count when someone reads a message", "track typing indicators" | Subscribe to the corresponding `CometChat*Events` topic (`CometChatMessageEvents.ccMessageSent`, `ccMessageRead`, `CometChatUserEvents.ccUserOnline`, etc.) — query the MCP for the event topic |
|
|
400
418
|
| **E. Component-level CSS** | "make incoming bubbles green", "hide the conversation timestamps", "compact the message list spacing" | Add a CSS rule under `.cometchat <selector>` in the integration's global stylesheet — query the MCP for the right selector class. NEVER invent class names; the SDK's selectors are namespaced and prefix-protected. |
|
|
401
419
|
| **F. Component composition** | "wrap CometChatConversations with my own search bar", "render two CometChatGroups side by side", "embed CometChatMessageList inside my own card layout" | Standard React composition. The CometChat components are React components — use them like any other component. Query the MCP for which props are required vs optional. |
|
|
402
420
|
|
|
421
|
+
> **Message templates / options / composer attachments → use the verified recipes in `cometchat-features` §Type 5**, not a hand-rolled `bubbleView`. Sending a custom message TYPE, overriding an existing type's bubble, adding a Forward-style message action, or adding a composer attachment all require the **append-not-replace** `CometChatUIKit.getDataSource()` merge (a bare `templates=`/`attachmentOptions=` array silently wipes the built-ins — ENG-35706). §Type 5 has the copy-ready, tsc-verified code.
|
|
422
|
+
|
|
403
423
|
If the user's request doesn't fit any bucket, **ask them to clarify** —
|
|
404
424
|
don't guess. Customization is the place where ambiguous requests
|
|
405
425
|
produce wrong code most often.
|
|
@@ -531,11 +551,13 @@ skill's Phase B menu.
|
|
|
531
551
|
show up in `cometchat info` as modified. That's correct.
|
|
532
552
|
- **Prefer composition over CSS overrides** when both are options —
|
|
533
553
|
composition is stable across SDK versions; CSS selectors are not.
|
|
534
|
-
- **Never invent CSS class names** —
|
|
535
|
-
prefix is `.cometchat-` but the leaf names (`-message-bubble-incoming`,
|
|
554
|
+
- **Never invent CSS class names** — look them up in the docs. The SDK's
|
|
555
|
+
class prefix is `.cometchat-` but the leaf names (`-message-bubble-incoming`,
|
|
536
556
|
`-conversations-header`, etc.) MUST come from the docs.
|
|
537
|
-
- **
|
|
538
|
-
|
|
557
|
+
- **Look up the docs via the best available path** (see §2's lookup
|
|
558
|
+
contract): docs MCP if your agent has it → else fetch/web-search the
|
|
559
|
+
public docs at cometchat.com/docs. Never STOP just because the MCP
|
|
560
|
+
isn't installed — fall through to the public docs.
|
|
539
561
|
- **Always use `npx @cometchat/skills-cli`** for any CLI commands.
|
|
540
562
|
|
|
541
563
|
## What this skill does NOT do
|
|
@@ -543,8 +565,8 @@ skill's Phase B menu.
|
|
|
543
565
|
- It does not write **template** files (that's `cometchat init`)
|
|
544
566
|
- It does not **enable packaged features** (that's `cometchat-features`
|
|
545
567
|
+ `cometchat apply-feature`)
|
|
546
|
-
- It does not **change theme tokens** (that's `cometchat-theming`
|
|
547
|
-
|
|
568
|
+
- It does not **change theme tokens** (that's `cometchat-theming` —
|
|
569
|
+
CSS-variable overrides, no CLI)
|
|
548
570
|
- It does not **fix broken integrations** (that's
|
|
549
571
|
`cometchat-troubleshooting` + `cometchat doctor`)
|
|
550
572
|
- It does not **add new components from scratch** — it customizes
|
|
@@ -553,3 +575,6 @@ skill's Phase B menu.
|
|
|
553
575
|
For anything in the "does not" list, route the user to the right
|
|
554
576
|
skill/command instead of attempting it here.
|
|
555
577
|
|
|
578
|
+
## Sound (in-app message + call sounds)
|
|
579
|
+
|
|
580
|
+
Sound is a customization sub-dimension. The UI Kit plays incoming/outgoing message + call sounds via `CometChatSoundManager` — mute it, swap custom audio, or play a specific sound. The full API + recipe lives in **`cometchat-theming`** (Sound section). Verify the access path against the installed kit before relying on it.
|
|
@@ -3,13 +3,16 @@ name: cometchat-features
|
|
|
3
3
|
description: Add features (calls, reactions, polls, file sharing, presence, etc.) to an already-integrated CometChat project. Routes to the right sub-flow based on feature type — default (already enabled), extension (API toggle), ai-feature (API toggle + OpenAI key), dashboard-only (third-party config), package-install (calls), or component-swap (rich text).
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Node.js >=18; @cometchat/chat-uikit-react ^6; integration must already be applied"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat features extensions calls reactions polls ai-features"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** the 5-tier feature catalog `packages/registry/v6/features/catalog.json` + the per-platform UI Kit `defaultExtensions[]`. (Official docs linked below.) Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
14
|
+
> **Scope — this IS the web / React features skill** (`@cometchat/chat-uikit-react`). Web/React intentionally has no separate "react-features" skill: this one is it. Each other family has its own features skill (native / angular / android-v5 / android-v6 / ios / flutter-v6). **Flutter V5 has none — it proxies to `cometchat-flutter-v6-features`** for enablement: feature *enablement* is the SDK/dashboard `apply-feature` path (identical across V5/V6); only the in-UI wiring differs, and V5 is legacy/maintenance-only. The `apply-feature` CLI + the 5-tier taxonomy below apply to all families.
|
|
15
|
+
|
|
13
16
|
> **Companion skills:** `cometchat-core` covers initialization and the
|
|
14
17
|
> provider pattern; `cometchat-customization` is the next step when a
|
|
15
18
|
> feature is enabled but needs visual customization;
|
|
@@ -52,10 +55,31 @@ npx @cometchat/skills-cli info --json
|
|
|
52
55
|
If `integrated` is `false`, **stop** and tell the user to run `/cometchat`
|
|
53
56
|
first to create the integration.
|
|
54
57
|
|
|
55
|
-
## 3.
|
|
58
|
+
## 3. The 5 feature categories (customer-facing) — and what work each needs
|
|
59
|
+
|
|
60
|
+
CometChat's canonical "Feature Availability" model sorts every feature into **5 categories by the work needed** (the catalog encodes this per-feature as `tier` + the operative columns `code` / `dashboard_settings` / `builder`; run `cometchat features info <id> --json`).
|
|
61
|
+
|
|
62
|
+
> **Canonical public decision-reference (source of truth):** [Features & Extensions Guide](https://www.cometchat.com/docs/fundamentals/features-and-extensions-guide) on the public docs. It is the authoritative, always-current matrix of *which integration method supports each feature* (UI Kit / UI Kit Builder / Widget Builder / SDK), *what dashboard setup it needs*, and *whether code is required*. **When the local `catalog.json` and this page disagree, the docs page wins** — the catalog is a build-time snapshot derived from the same model and can lag a release. For any "can the builder do X? / is feature Y code-or-dashboard?" decision, consult this page (WebFetch it, or query the docs MCP) rather than answering from memory or a stale snapshot.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
| Tier | Category | Work needed | Example |
|
|
67
|
+
|---|---|---|---|
|
|
68
|
+
| **1** | Core Messaging (Zero Setup) | Nothing — renders out of the box | Typing Indicators |
|
|
69
|
+
| **2** | Builder-Enabled (Config + UI Toggle) | Enable via Dashboard API; toggle/place in the UI Kit Builder | Polls |
|
|
70
|
+
| **3** | Config-Only (Dashboard-Driven) | Enable via Dashboard API; works automatically | Link Preview |
|
|
71
|
+
| **4** | Config + Settings (Smart) | Dashboard API + extra settings (API keys, thresholds) — no code | Smart Replies |
|
|
72
|
+
| **5** | SDK-Integrated (Config + Code) | Dashboard API + **custom client code** | Bitly |
|
|
73
|
+
|
|
74
|
+
Tiers 1–4 need **no client code** (`code: "none"`). **Tier 5 needs code — and the implementation already lives in the docs.** When a feature's `code` is `custom-code` or `steps-in-docs` (i.e. `auto_wired_in_uikit: false`), the flow is: flip the dashboard toggle (`apply-feature <id>`), then **fetch the reference implementation from the docs (`docs_topic`, via the docs MCP) and adapt it — do NOT hand-roll.** A few Core features carry `code: "stitch-components"` (e.g. Threaded Conversations, Advanced Search): no extension, but you **compose existing kit components** — the kit sample apps show the wiring (see [[uikit-local-clones-canonical-source]]). The 14 code-needed extensions: bitly, message-shortcuts, pin-message, rich-media-preview, save-message, tinyurl, voice-transcription, giphy, reminders, stipop, tenor, disappearing-messages, chatwoot, intercom.
|
|
75
|
+
|
|
76
|
+
> T2 vs T3 is a Builder-surface nuance (does the Builder expose a placement/toggle for it). Operationally both are "enable via Dashboard, no code" — the `builder: "toggle"` flag marks the ones the Builder surfaces.
|
|
56
77
|
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 3b. Enablement mechanism (how the CLI flips each on)
|
|
81
|
+
|
|
82
|
+
Independently of the 5 customer-facing tiers above, the catalog tags each feature with an **enablement mechanism** — what the CLI's `apply-feature` actually does:
|
|
59
83
|
|
|
60
84
|
- **default (compiled-in):** Shipped inside the UI Kit component bundle
|
|
61
85
|
unconditionally. CometChat builds reactions, typing indicators,
|
|
@@ -67,7 +91,8 @@ needed to enable each one:
|
|
|
67
91
|
The CLI's `apply-feature` command flips the toggle via the same REST
|
|
68
92
|
API the dashboard UI uses (`POST /apps/{id}/extensions`), so no
|
|
69
93
|
browser visit required. Once enabled, the UI Kit renders the matching
|
|
70
|
-
UI automatically
|
|
94
|
+
UI automatically **only for the auto-wired subset** (`auto_wired_in_uikit: true`,
|
|
95
|
+
`code: "none"`); the rest (tier 5) need client code from the docs. Examples: polls, link-preview,
|
|
71
96
|
message-translation, stickers.
|
|
72
97
|
|
|
73
98
|
- **ai-feature (backend AI toggle + OpenAI key):** Same API path as
|
|
@@ -140,7 +165,13 @@ For native cohorts (iOS / Android / Flutter / Angular) where there's no
|
|
|
140
165
|
cometchat apply-feature <id> --app-id <your-app-id>
|
|
141
166
|
```
|
|
142
167
|
|
|
143
|
-
Once enabled, the UI Kit auto-integrates them. **No code changes needed.**
|
|
168
|
+
Once enabled, the UI Kit auto-integrates them. **No code changes needed — for the auto-wired subset.**
|
|
169
|
+
|
|
170
|
+
> ⚠️ **The "no code needed" pitch only holds for ~7 of 24 dashboard-toggle features (ENG-35721).** The dashboard exposes 24 extensions; only the ones marked `auto_wired_in_uikit: true` in the CLI's catalog (~7 — Link Preview, Polls, Stickers, Message Translation, Smart Replies, Conversation Starter, and a handful more) render automatically via the kit's bubbles + composer. The other ~17 (Bitly, TinyURL, Voice Transcription, Reminders, Save Message, Pin Message, etc.) require **either a kit prop opt-in OR a small component-side handler** — `apply-feature <id>` flips the dashboard toggle but does NOT wire client-side rendering for those. **Before promising "no code needed" to the customer**, run `cometchat features info <id> --json` and check the `auto_wired_in_uikit` field; if `false`, set expectations honestly and emit the wiring code.
|
|
171
|
+
|
|
172
|
+
> ⚠️ **`features enable` has TWO unstated prereqs (ENG-35721):**
|
|
173
|
+
> 1. **`auth login` must have completed** — the toggle is gated on the dashboard bearer token. The CLI's "no app" error says nothing about login; running `cometchat features enable <id>` cold (after only `provision setup`) fails with a misleading message. Run `cometchat auth status --json` first; if `"logged-out"`, run `cometchat auth login` before any `features enable`.
|
|
174
|
+
> 2. **Either `.cometchat/config.json` OR `--app-id <id>`** — the toggle needs an app context. If the user pasted credentials manually (the dispatcher's Step 2d path) they may NOT have a `.cometchat/config.json` yet. **Manual `.env` users:** run `cometchat config save --app-id <id> --region <region> --json` to bridge into `.cometchat/config.json` before `apply-feature`, OR pass `--app-id` on every `apply-feature` call.
|
|
144
175
|
|
|
145
176
|
> **Note:** Conversation and Advanced Search has its own toggle on the
|
|
146
177
|
> Features page. It is on by default but can be disabled. If a user
|
|
@@ -152,21 +183,23 @@ Media Preview, Save Message, Thumbnail Generation, TinyURL, Voice
|
|
|
152
183
|
Transcription
|
|
153
184
|
|
|
154
185
|
**Extensions — User Engagement:**
|
|
155
|
-
|
|
186
|
+
Giphy, Message Translation, Polls, Reminders,
|
|
156
187
|
Stickers, Stipop, Tenor
|
|
157
188
|
|
|
189
|
+
> ⚠️ **Broadcast was removed (ENG-35699).** Earlier versions of this skill listed "Broadcast" here, but the CLI's 40-feature catalog has no `broadcast` or `broadcast-message` id — `cometchat-skills-cli features info broadcast` returns "not found." Broadcast as a *use case* is achievable via standard CometChat extensions (one-to-many group messages with `subscribePresenceForAllUsers`) or via Custom Messages — but there is no "Broadcast" extension toggle in the dashboard today. If a customer asks for broadcast functionality, route them at custom messages + a server-side fan-out webhook, not a feature toggle.
|
|
190
|
+
|
|
158
191
|
**Extensions — Collaboration:**
|
|
159
192
|
Collaborative Document, Collaborative Whiteboard
|
|
160
193
|
|
|
161
194
|
**Extensions — Security:**
|
|
162
195
|
Disappearing Messages, E2E Encryption (Enterprise plan only)
|
|
163
196
|
|
|
164
|
-
**Extensions — Moderation
|
|
197
|
+
**Extensions — Moderation (LEGACY — prefer Rules Management, see §"Moderation" below):**
|
|
165
198
|
Data Masking, Image Moderation, Profanity Filter, Sentiment Analysis,
|
|
166
199
|
XSS Filter, Human Moderation, Report User, Slow Mode,
|
|
167
|
-
Virus/Malware Scanner
|
|
200
|
+
Virus/Malware Scanner. ⚠️ Deprecated; don't run alongside moderation Rules (double-processes every message).
|
|
168
201
|
|
|
169
|
-
**
|
|
202
|
+
**Notifications extensions** (Chat & Messaging → Features):
|
|
170
203
|
Email Notification, Push Notification, SMS Notification
|
|
171
204
|
|
|
172
205
|
**Extensions — Customer Support:**
|
|
@@ -202,21 +235,28 @@ CLI cannot automate these:
|
|
|
202
235
|
|
|
203
236
|
Manual flow for these:
|
|
204
237
|
1. https://app.cometchat.com → select your app
|
|
205
|
-
2. Sidebar →
|
|
206
|
-
Disappearing Messages)
|
|
238
|
+
2. Sidebar → Chat & Messaging → Features
|
|
207
239
|
3. Find the extension, enter the third-party config, toggle ON
|
|
208
240
|
|
|
209
|
-
### Moderation
|
|
241
|
+
### Moderation — use Rules Management (NOT the legacy extensions)
|
|
210
242
|
|
|
211
|
-
|
|
212
|
-
|
|
243
|
+
**The canonical moderation system is Rules Management**, not the old per-extension
|
|
244
|
+
toggles. Configure rules once in the Dashboard (**Moderation → Settings → Rules**,
|
|
245
|
+
or the `/moderation/rules` REST API — also `/moderation/{keywords,reasons,
|
|
246
|
+
blocked-messages,flagged-messages,reviewed-messages}`) and they auto-apply to every
|
|
247
|
+
message with **no client code** (the UI Kit + SDK enforce them seamlessly). Docs:
|
|
248
|
+
`moderation/overview` + `moderation/rules-management`.
|
|
213
249
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
250
|
+
> ⚠️ **Do NOT run legacy moderation extensions AND Rules on the same app.** The
|
|
251
|
+
> legacy extensions (Data Masking, Image Moderation, Profanity Filter, Sentiment
|
|
252
|
+
> Analysis, XSS Filter, Slow Mode, Virus/Malware Scanner) are **deprecated**. If
|
|
253
|
+
> both a legacy extension and a Rule are active, **every message is processed
|
|
254
|
+
> twice** → delays + perf issues. Disable the legacy extensions (Dashboard →
|
|
255
|
+
> Extensions) before creating Rules. `apply-feature <legacy-id>` still works but
|
|
256
|
+
> emits this same warning — prefer Rules.
|
|
218
257
|
|
|
219
|
-
|
|
258
|
+
- **Notifications** (separate, unaffected): Email, Push, SMS — Sidebar →
|
|
259
|
+
**Extensions** → configure + enable.
|
|
220
260
|
|
|
221
261
|
After enabling any feature, run `cometchat verify` to ensure the
|
|
222
262
|
existing integration still passes. No code changes are needed — the
|
|
@@ -244,6 +284,218 @@ The UI Kit's `initiateAfterLogin()` auto-calls `enableCalling()` after the
|
|
|
244
284
|
package is installed. No manual wiring needed for default call buttons in
|
|
245
285
|
CometChatMessageHeader. Restart the dev server.
|
|
246
286
|
|
|
287
|
+
### Type 5 — Custom message types (APPEND, never REPLACE — ENG-35706)
|
|
288
|
+
|
|
289
|
+
When a customer wants to send a new message type (location, product card, custom event), the V6 React kit ships a templates API that is **dangerously easy to misuse.** Two testers hit the same trap: they added one custom template and watched ALL existing bubbles (text, image, audio, video, file) disappear AND the composer's entire attachment menu (Camera/Image/Video/File/Whiteboard/Document) get replaced by their one new attachment.
|
|
290
|
+
|
|
291
|
+
**Cause:** `<CometChatMessageList templates={[locationTemplate]} />` and `<CometChatMessageComposer attachmentOptions={[locationOption]} />` **REPLACE** the kit's built-in templates / options rather than appending to them.
|
|
292
|
+
|
|
293
|
+
**Correct pattern — always merge with the kit's defaults:**
|
|
294
|
+
|
|
295
|
+
```tsx
|
|
296
|
+
import {
|
|
297
|
+
CometChatMessageList,
|
|
298
|
+
CometChatMessageComposer,
|
|
299
|
+
CometChatMessageTemplate, // the kit's template class — verified export (src/index.ts:79)
|
|
300
|
+
CometChatMessageComposerAction, // attachment-menu action class
|
|
301
|
+
CometChatUIKit, // exposes getDataSource()
|
|
302
|
+
CometChatUIKitConstants, // MessageTypes / MessageCategory enums
|
|
303
|
+
} from "@cometchat/chat-uikit-react";
|
|
304
|
+
|
|
305
|
+
// 1. Build your custom template with the kit's CometChatMessageTemplate class.
|
|
306
|
+
// ⚠️ It is `new CometChatMessageTemplate(...)` (UI Kit) — NOT
|
|
307
|
+
// `new CometChat.MessageTemplate(...)`. The Chat SDK has no MessageTemplate
|
|
308
|
+
// export; that form does not exist and will not compile.
|
|
309
|
+
const locationTemplate = new CometChatMessageTemplate({
|
|
310
|
+
type: "location",
|
|
311
|
+
category: CometChatUIKitConstants.MessageCategory.custom, // "custom"
|
|
312
|
+
contentView: (message, alignment) => <LocationBubble message={message} />,
|
|
313
|
+
// headerView / footerView / bottomView / bubbleView / statusInfoView / options
|
|
314
|
+
// all inherit the kit's defaults when omitted.
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// 2. Merge with the kit's defaults — DO NOT pass only your template.
|
|
318
|
+
// CometChatUIKit.getDataSource() is the public accessor; it returns the same
|
|
319
|
+
// DataSource as ChatConfigurator.getDataSource() (the latter is internal).
|
|
320
|
+
const defaultTemplates = CometChatUIKit.getDataSource().getAllMessageTemplates();
|
|
321
|
+
const mergedTemplates = [...defaultTemplates, locationTemplate];
|
|
322
|
+
|
|
323
|
+
<CometChatMessageList templates={mergedTemplates} />
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**Same rule for attachment options.** `getAttachmentOptions` takes a `ComposerId` (`{ user?, group?, parentMessageId? }`) **AND a required second argument** (`additionalConfigurations`), then append your action:
|
|
327
|
+
|
|
328
|
+
```tsx
|
|
329
|
+
// ComposerId = { parentMessageId, user, group } — all three keys, values nullable.
|
|
330
|
+
const composerId = {
|
|
331
|
+
parentMessageId: null,
|
|
332
|
+
user: selectedUser?.getUid() ?? null,
|
|
333
|
+
group: selectedGroup?.getGuid() ?? null,
|
|
334
|
+
};
|
|
335
|
+
// ⚠️ MUST pass a defined object as the 2nd arg. The extension data sources
|
|
336
|
+
// (Polls, Collaborative Document/Whiteboard) read `messageToReplyRef` off it
|
|
337
|
+
// WITHOUT optional chaining — passing nothing/undefined throws at runtime:
|
|
338
|
+
// "Cannot read properties of undefined (reading 'messageToReplyRef')"
|
|
339
|
+
// (Verified against the official v6 sample app's live-location feature.)
|
|
340
|
+
const additionalConfigurations = { messageToReplyRef: { current: null } };
|
|
341
|
+
const defaultAttachments = CometChatUIKit.getDataSource().getAttachmentOptions(
|
|
342
|
+
composerId,
|
|
343
|
+
additionalConfigurations,
|
|
344
|
+
);
|
|
345
|
+
const mergedAttachments = [...defaultAttachments, new CometChatMessageComposerAction({
|
|
346
|
+
id: "send-location",
|
|
347
|
+
title: "Location",
|
|
348
|
+
iconURL: "/icons/location.svg",
|
|
349
|
+
onClick: () => { /* open location picker */ },
|
|
350
|
+
})];
|
|
351
|
+
|
|
352
|
+
<CometChatMessageComposer attachmentOptions={mergedAttachments} />
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
**Also**: when sending the custom message, set both `receiverType` AND `type` correctly. Two testers hit `"Cannot determine message recipient"` because they passed a partial `CustomMessage` constructor. Use the full form:
|
|
356
|
+
|
|
357
|
+
```tsx
|
|
358
|
+
const msg = new CometChat.CustomMessage(
|
|
359
|
+
receiverID, // who to send to (required)
|
|
360
|
+
receiverType, // CometChat.RECEIVER_TYPE.USER or .GROUP (required — this is the field testers missed)
|
|
361
|
+
"location", // custom type identifier
|
|
362
|
+
{ lat, lng, label } // your payload
|
|
363
|
+
);
|
|
364
|
+
CometChat.sendCustomMessage(msg);
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
> **Custom type sends + renders live, but vanishes on reload?** The custom message
|
|
368
|
+
> appears immediately (the `ccMessageSent` event), but to **fetch it from history**
|
|
369
|
+
> you must include your custom category + type in the list's `messagesRequestBuilder`.
|
|
370
|
+
> Extend the kit's defaults (don't hand-list them) — append to
|
|
371
|
+
> `getAllMessageCategories()` + `getAllMessageTypes()`:
|
|
372
|
+
>
|
|
373
|
+
> ```tsx
|
|
374
|
+
> const categories = CometChatUIKit.getDataSource().getAllMessageCategories();
|
|
375
|
+
> if (!categories.includes(CometChatUIKitConstants.MessageCategory.custom))
|
|
376
|
+
> categories.push(CometChatUIKitConstants.MessageCategory.custom);
|
|
377
|
+
> const types = CometChatUIKit.getDataSource().getAllMessageTypes();
|
|
378
|
+
> if (!types.includes("location")) types.push("location");
|
|
379
|
+
>
|
|
380
|
+
> const messagesRequestBuilder = new CometChat.MessagesRequestBuilder()
|
|
381
|
+
> .setCategories(categories).setTypes(types).hideReplies(true).setLimit(30);
|
|
382
|
+
>
|
|
383
|
+
> <CometChatMessageList templates={mergedTemplates} messagesRequestBuilder={messagesRequestBuilder} />
|
|
384
|
+
> ```
|
|
385
|
+
> (Verified against the official v6 sample app's live-location feature.) Tip: on the
|
|
386
|
+
> `CustomMessage`, call `setConversationText("Live Location")` so it reads nicely as
|
|
387
|
+
> the conversation-list preview, and `setSender(loggedInUser)` for optimistic render.
|
|
388
|
+
|
|
389
|
+
#### Override an existing message type's bubble (text / image / etc.)
|
|
390
|
+
|
|
391
|
+
Same templates API — fetch all, replace `contentView` (or `bubbleView` for the whole bubble) on the matching template, pass the array. There is NO separate "override" call; you reuse `getAllMessageTemplates()`:
|
|
392
|
+
|
|
393
|
+
```tsx
|
|
394
|
+
const templates = CometChatUIKit.getDataSource().getAllMessageTemplates();
|
|
395
|
+
const withCustomTextBubble = templates.map((t) => {
|
|
396
|
+
if (
|
|
397
|
+
t.type === CometChatUIKitConstants.MessageTypes.text &&
|
|
398
|
+
t.category === CometChatUIKitConstants.MessageCategory.message
|
|
399
|
+
) {
|
|
400
|
+
t.contentView = (message, alignment) => <MyTextBubble message={message} />;
|
|
401
|
+
// or t.bubbleView = (...) => <... /> to replace the ENTIRE bubble (header+content+footer)
|
|
402
|
+
}
|
|
403
|
+
return t;
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
<CometChatMessageList templates={withCustomTextBubble} />
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
(`CometChatUIKit.getDataSource().getMessageTemplate(type, category)` returns a single template if you'd rather fetch just one — but you still pass the full array to the `templates` prop.)
|
|
410
|
+
|
|
411
|
+
#### Add a custom message option (Forward-style long-press action)
|
|
412
|
+
|
|
413
|
+
Message options live on each template's `options` function. Override it and **merge with the kit defaults** (same REPLACE-vs-APPEND rule) via `getMessageOptions`. Custom actions use `CometChatActionsIcon` (NOT `CometChatMessageComposerAction` — that's composer-only):
|
|
414
|
+
|
|
415
|
+
```tsx
|
|
416
|
+
import { CometChatActionsIcon } from "@cometchat/chat-uikit-react";
|
|
417
|
+
|
|
418
|
+
const templates = CometChatUIKit.getDataSource().getAllMessageTemplates();
|
|
419
|
+
const withForward = templates.map((t) => {
|
|
420
|
+
if (t.type === CometChatUIKitConstants.MessageTypes.text) {
|
|
421
|
+
t.options = (loggedInUser, message, group) => {
|
|
422
|
+
// getMessageOptions(loggedInUser, messageObject, group?, additionalParams?)
|
|
423
|
+
const options = CometChatUIKit.getDataSource().getMessageOptions(loggedInUser, message, group);
|
|
424
|
+
options.push(
|
|
425
|
+
new CometChatActionsIcon({
|
|
426
|
+
id: "forward",
|
|
427
|
+
title: "Forward",
|
|
428
|
+
iconURL: "/icons/forward.svg",
|
|
429
|
+
onClick: (id) => { /* open your forward-to picker → CometChat.sendMessage(...) */ },
|
|
430
|
+
})
|
|
431
|
+
);
|
|
432
|
+
return options;
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
return t;
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
<CometChatMessageList templates={withForward} />
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
"Forward" is not a built-in kit option, so it's added as a custom `CometChatActionsIcon`. The built-ins (reply, edit, delete, react, …) come from `getMessageOptions` — keep them by merging, don't return only your action.
|
|
442
|
+
|
|
443
|
+
> ⚠️ **Kit-side limitation (ENG-35706):** custom message send sometimes **replaces** an existing message in the list in real-time (UI-side overwrite, not server-side). No client workaround today; file a kit ticket if you observe this and document for the customer.
|
|
444
|
+
|
|
445
|
+
#### Text formatters (inline text styling — mentions, URLs, custom @/#/! tokens)
|
|
446
|
+
|
|
447
|
+
Text formatters transform message text inline. The kit ships `CometChatMentionsFormatter`, `CometChatUrlsFormatter`, `CometChatMarkdownFormatter` (all subclasses of the base `CometChatTextFormatter`). **Same APPEND-not-REPLACE rule** as templates/options: passing a bare `textFormatters={[...]}` array drops the built-ins — start from `getAllTextFormatters({})` and append. (Pattern verified against the kit sample app `sample-app/src/components/CometChatMessages/CometChatMessages.tsx`.)
|
|
448
|
+
|
|
449
|
+
```tsx
|
|
450
|
+
import {
|
|
451
|
+
CometChatUIKit,
|
|
452
|
+
CometChatMessageList,
|
|
453
|
+
CometChatTextFormatter,
|
|
454
|
+
} from "@cometchat/chat-uikit-react";
|
|
455
|
+
|
|
456
|
+
// getAllTextFormatters({}) returns the kit defaults (mentions, URLs, …).
|
|
457
|
+
// START here and append — don't hand the component a bare array.
|
|
458
|
+
const formatters: CometChatTextFormatter[] =
|
|
459
|
+
CometChatUIKit.getDataSource().getAllTextFormatters({});
|
|
460
|
+
|
|
461
|
+
// Append your own: subclass CometChatTextFormatter (override its regex + view
|
|
462
|
+
// hooks) and push it. See the per-pattern guides below for full subclasses.
|
|
463
|
+
// formatters.push(new MyHashtagFormatter());
|
|
464
|
+
|
|
465
|
+
<CometChatMessageList textFormatters={formatters} />;
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
> **Guides (canonical subclass examples):** custom-text-formatter-guide, mentions-formatter-guide, url-formatter-guide, shortcut-formatter-guide — all under `ui-kit/react/` (query the docs MCP, or `documentation/docs/ui-kit/react/*-formatter-guide.mdx` locally). Each shows a complete `CometChatTextFormatter` subclass (regex + `getFormattedText` + a custom view).
|
|
469
|
+
|
|
470
|
+
### Type 6 — Dashboard-AI mode (UI-side side-effects — ENG-35706)
|
|
471
|
+
|
|
472
|
+
When the customer enables the AI Agent on the dashboard (e.g. `aiAssistant: true` for an app), the SAME `<CometChatMessageList>` renders with thread reply buttons + call buttons that don't make sense in an AI-only conversation surface.
|
|
473
|
+
|
|
474
|
+
**Detect AI mode and branch the layout:**
|
|
475
|
+
|
|
476
|
+
```tsx
|
|
477
|
+
// Read app's AI config from the dashboard via the CLI
|
|
478
|
+
// npx @cometchat/skills-cli features info ai-assistant --json
|
|
479
|
+
// → { enabled: true, models: [...], ... }
|
|
480
|
+
|
|
481
|
+
const isAiMode = aiAssistantConfig?.enabled === true;
|
|
482
|
+
|
|
483
|
+
<CometChatMessageList
|
|
484
|
+
user={selectedUser}
|
|
485
|
+
group={selectedGroup}
|
|
486
|
+
// AI conversations shouldn't show "Reply in Thread" / "Message Privately" / call buttons
|
|
487
|
+
hideReplyInThreadOption={true}
|
|
488
|
+
// (call buttons live on CometChatMessageHeader, NOT MessageList — hide them there)
|
|
489
|
+
/>
|
|
490
|
+
<CometChatMessageHeader
|
|
491
|
+
user={selectedUser}
|
|
492
|
+
hideVideoCallButton={isAiMode}
|
|
493
|
+
hideVoiceCallButton={isAiMode}
|
|
494
|
+
/>
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
The kit doesn't auto-detect dashboard AI mode and adjust its layout — that's a kit-side gap (filed as part of ENG-35706). Until the kit ships a built-in `aiMode` prop, the skill must read the dashboard flag via `features info ai-assistant --json` (see ENG-35716 dispatcher rule) and gate the relevant buttons.
|
|
498
|
+
|
|
247
499
|
### Type 4 — Component-swap features (drop-in variant)
|
|
248
500
|
|
|
249
501
|
Some features require swapping one component for a variant that has
|
|
@@ -299,7 +551,9 @@ export function CustomCallUI({ targetUser }: { targetUser: CometChat.User }) {
|
|
|
299
551
|
new CometChat.CallListener({
|
|
300
552
|
onOutgoingCallAccepted: (call: CometChat.Call) => setOngoingCall(call),
|
|
301
553
|
onIncomingCallCancelled: () => setOngoingCall(undefined),
|
|
302
|
-
|
|
554
|
+
// CallListener uses onCallEndedMessageReceived (NOT onCallEnded — that's
|
|
555
|
+
// an OngoingCallListener callback, passed to CallSettingsBuilder).
|
|
556
|
+
onCallEndedMessageReceived: () => setOngoingCall(undefined),
|
|
303
557
|
}),
|
|
304
558
|
);
|
|
305
559
|
return () => CometChat.removeCallListener(listenerId);
|
|
@@ -315,11 +569,24 @@ export function CustomCallUI({ targetUser }: { targetUser: CometChat.User }) {
|
|
|
315
569
|
}
|
|
316
570
|
```
|
|
317
571
|
|
|
318
|
-
**Common gotchas:**
|
|
572
|
+
**Common gotchas — UI Kit path:**
|
|
319
573
|
- Calls require a logged-in CometChat user on *both* sides. Test from two browsers (or incognito) logged in as different UIDs.
|
|
320
574
|
- `CometChatIncomingCall` must be mounted globally (e.g. in your provider or layout) so incoming calls ring on every page.
|
|
321
575
|
- Group calls use `CometChat.Group` instead of `CometChat.User` on `CometChatCallButtons`.
|
|
322
576
|
|
|
577
|
+
**Common gotchas — SDK-only path (no UI Kit components, ENG-35707 Birendra follow-up):**
|
|
578
|
+
|
|
579
|
+
When the integrator opts out of `<CometChatCallButtons>` / `<CometChatIncomingCall>` / `<CometChatOngoingCall>` and builds the call surface directly on the Calls SDK, the UI-Kit gotchas above don't apply but a different set kicks in:
|
|
580
|
+
|
|
581
|
+
- **`CometChat.CALL_TYPE.AUDIO` vs `.VIDEO` (Chat SDK)** are NOT the same as **`CometChatCalls.constants.TYPE.VOICE` / `.VIDEO` (Calls SDK)** — use Chat SDK enum on the `Call` entity, Calls SDK enum on `CallSettings`. See `cometchat-react-calls` §4c constants table.
|
|
582
|
+
- **`setIsAudioOnlyCall(true)` on `CallSettingsBuilder`** for voice calls — without it, voice calls still acquire the camera (just don't render it).
|
|
583
|
+
- **`joinSession` MUST fire after the container is mounted** — don't call it inside the `onOutgoingCallAccepted` listener directly; set state and let a `useEffect(phase, containerRef)` join when the ref + phase agree. The natural site fires before the in-call panel renders.
|
|
584
|
+
- **Group calls have no "ring a group" primitive** — use a CustomMessage broadcast + a shared sessionId; the UI Kit's `CometChatCallButtons` for groups sends a `meeting`-type CustomMessage, not `initiateCall`. SDK-only mirrors that.
|
|
585
|
+
- **Default call types** — 1:1 = video, group = voice (mirroring the kit's defaults). If you build custom buttons, replicate this so customers' integrations behave consistently.
|
|
586
|
+
- **`CometChatCalls.login` is mandatory on raw-SDK paths** (NOT when using the UI Kit, where `enableCalls = true` / kit-managed init auto-logs the Calls SDK). On raw SDK, after Chat SDK login, separately call `CometChatCalls.login(uid, apiKey)` — without it, `generateToken` returns 401.
|
|
587
|
+
|
|
588
|
+
These map to the React-specific recipes in `cometchat-react-calls` §4c. Same primitives apply across families; container-mount race + ref-state coordination is generic.
|
|
589
|
+
|
|
323
590
|
### AI smart replies
|
|
324
591
|
|
|
325
592
|
Smart replies is an `ai-feature`. Enable with one CLI call (the first time also sets the OpenAI key on the app):
|
|
@@ -402,25 +669,36 @@ export function useUserPresence(uid: string): "online" | "offline" | "unknown" {
|
|
|
402
669
|
|
|
403
670
|
---
|
|
404
671
|
|
|
405
|
-
## 5. Docs
|
|
672
|
+
## 5. Docs lookup contract
|
|
406
673
|
|
|
407
|
-
|
|
408
|
-
|
|
674
|
+
For any feature question not in our local catalog (`cometchat features
|
|
675
|
+
info`), the canonical CometChat docs are the source of truth for:
|
|
409
676
|
|
|
677
|
+
- **Feature/method availability matrix** — [Features & Extensions Guide](https://www.cometchat.com/docs/fundamentals/features-and-extensions-guide): which of UI Kit / UI Kit Builder / Widget Builder / SDK supports each feature, dashboard setup, and code-required flags. **This page outranks the local `catalog.json` snapshot when they disagree.**
|
|
410
678
|
- Per-feature SDK reference (props, callbacks, builders, events)
|
|
411
679
|
- Per-feature configuration details beyond the dashboard path above
|
|
412
680
|
- Feature compatibility notes (which features need backend setup,
|
|
413
681
|
which auto-wire, which require explicit `setExtensions([...])`)
|
|
414
682
|
|
|
683
|
+
The docs MCP at `cometchat-docs` is the **best** way to query them when
|
|
684
|
+
available, but it is **not** a hard requirement.
|
|
685
|
+
|
|
415
686
|
**Hard rules:**
|
|
416
687
|
|
|
417
|
-
1. **
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
688
|
+
1. **Look up the docs before answering** any feature question that's not
|
|
689
|
+
in our local catalog. Never invent feature config from training-data
|
|
690
|
+
memory. Use whichever lookup path is available, in order:
|
|
691
|
+
- **(a) docs MCP** — query the `cometchat-docs` MCP tool if your agent
|
|
692
|
+
has it. Richest path.
|
|
693
|
+
- **(b) install the MCP, if your agent supports it** — Claude Code:
|
|
694
|
+
`claude mcp add --transport http cometchat-docs
|
|
695
|
+
https://www.cometchat.com/docs/mcp`. Other agents (Cursor, Codex,
|
|
696
|
+
Cline, …) configure MCP their own way, or not at all — do NOT block.
|
|
697
|
+
- **(c) fetch/search the public docs** — same content at the canonical
|
|
698
|
+
URLs below, or web-search `site:cometchat.com/docs`. Universal
|
|
699
|
+
fallback; never STOP and dead-end the user when the MCP isn't
|
|
700
|
+
installed — fall through to (c).
|
|
701
|
+
2. **Use `cometchat apply-feature <id>` for extension and ai-feature
|
|
424
702
|
types.** The CLI is the canonical path. Only fall back to the
|
|
425
703
|
dashboard URL when the CLI returns `manual-action-required`,
|
|
426
704
|
`auth-required`, or `error`.
|
|
@@ -470,8 +748,9 @@ the type, query the docs MCP first.
|
|
|
470
748
|
advanced dual-scope search if the user wants that)
|
|
471
749
|
- "filter conversations / messages" → `conversationsRequestBuilder`
|
|
472
750
|
/ `messagesRequestBuilder`
|
|
473
|
-
- "custom empty / error / loading state" → `
|
|
474
|
-
`
|
|
751
|
+
- "custom empty / error / loading state" → `emptyView`,
|
|
752
|
+
`errorView`, `loadingView` on the list components (verified vs the v6
|
|
753
|
+
React kit; the `*StateView` form is only on `CometChatNotificationFeed`)
|
|
475
754
|
- "custom message bubble" → `templates` prop on
|
|
476
755
|
`CometChatMessageList` (NOT a custom bubble component)
|
|
477
756
|
- "hide / disable a sub-feature" → `disable*` boolean props
|