docs(js-sdk): document card message support (ENG-36071)#420
Conversation
Add a dedicated JavaScript SDK "Card Messages" page covering the three receive-only card mechanisms: standalone CardMessage (onCardMessageReceived), inline cards on AIAssistantMessage via getElements()/AIAssistantElement, and real-time card streaming events (card_start/card/card_end) on the AIAssistantListener. - Add sdk/javascript/card-messages.mdx with TS + JS receive/render examples - Add reference entries for CardMessage, AIAssistantElement, the elements accessor on AIAssistantMessage, and the three card events (messages.mdx) - Add onCardMessageReceived + card-events note to all-real-time-listeners.mdx - Add the card category to message-structure-and-hierarchy.mdx - Cross-link card handling from ai-agents.mdx - Register the new page in the Messaging nav group (docs.json) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
…verability Align the JS SDK card-message docs with the parallel React Native card docs after cross-referencing that branch: - Explain cards are authored server-side via the Platform (REST) API or Dashboard Bubble Builder (receive-only), with a link to the REST reference - Point to the CometChat Cards renderer (@cometchat/cards-react → CometChatCardView) and Campaigns "Rendering Cards" / "Supported Card Actions"; adopt the shared "Card Schema JSON" terminology - Document getTags() on CardMessage (page + reference) - Add a receive-only "Card Message" section to send-message.mdx so devs looking to send a card learn it must be created server-side - Note that a card-only assistant reply may have empty getText(), so prefer getElements() Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Docs review — ✅ ApproveJavaScript SDK card-messages docs — a new ✅ Verified against the ENG-36071 SDK branch
🟡 Note — pre-existing broken links (out of scope, not introduced here)The analyzer flagged 4 broken calling links, all in pre-existing lines (0 in this PR's additions): Ready to merge. 🚀 🤖 Automated docs review (Mintlify link/redirect/content checks + API verification against @cometchat/chat-sdk-javascript ENG-36071 branch). |
jitvarpatil
left a comment
There was a problem hiding this comment.
Docs review — ✅ Approve
JavaScript SDK card-messages docs — a new card-messages.mdx (385 lines) + SDK reference additions + listener/hierarchy updates (7 files, +504/-1). Nearly all-new content, no deletions → no redirect risk. I verified the entire JS card API against the matching SDK branch (ENG-36071-implement-card-messages-receive-only-support) — all correct. Introduces 0 new broken links.
✅ Verified against the ENG-36071 SDK branch
CardMessage—extends BaseMessage, withgetCard(): Object|undefined,getText(): string,getFallbackText(): string,getTags(): Array<String>— all match the docs.onCardMessageReceived(message: CometChat.CardMessage)— real MessageListener callback (dispatched inWSConnectionHelper.ts:843); added correctly to the listener table and examples inall-real-time-listeners.mdx.- Card streaming events —
AIAssistantCardStartedEvent,AIAssistantCardReceivedEvent,AIAssistantCardEndedEvent, andAIAssistantElementare each real exported classes; the reference-page accessors (getCard,getCardId,getExecutionText,streamMessageId,getType/getData) follow the SDK's getter convention and align with source (AIAssistantElement.getData()→{ card, cardId }). - Content correctness:
card-messages.mdxcorrectly states JS card support is receive-only; thesdk/reference/messages.mdxreference is comprehensive and consistent. - Structure: new
card-messages.mdxwired into nav; 0 build breaks, 0 orphans. No placeholders/TODOs.
🟡 Note — pre-existing broken links (out of scope, not introduced here)
The analyzer flagged 4 broken calling links, all in pre-existing lines (0 in this PR's additions): /sdk/javascript/direct-call, /sdk/javascript/default-call, /sdk/javascript/standalone-calling (in all-real-time-listeners.mdx:629 and message-structure-and-hierarchy.mdx; the real page is /sdk/javascript/calling-overview), and /sdk/javascript/interactive-messages (in send-message.mdx). They don't block this PR, but worth a follow-up cleanup.
Ready to merge. 🚀
🤖 Automated docs review (Mintlify link/redirect/content checks + API verification against @cometchat/chat-sdk-javascript ENG-36071 branch).
…howCardUI Replace the undefined showCardUI placeholder (called with an inconsistent 2nd argument) across all six call sites with a single renderCardView helper that returns a real CometChatCardView render. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Keep card render code framework-neutral: examples stop at getCard()/the raw payload with a "pass it to your card renderer" comment, matching the RN SDK guides. Name the CometChat Cards renderer only in prose (React / Angular / vanilla @cometchat/cards) with reference links. Removes the invented renderCardView / showText / showCardPlaceholder / finalizeCard helpers so the snippets use only real SDK getters. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Point the React row in the render note at /ui-kit/react/v6/card-messages, matching the Angular row's /ui-kit/angular/guides/card-messages link so both frameworks reference their own UI Kit Card Messages guide. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Simplify the render note to reference the React and Angular UI Kit Card Messages guides only. Removes the npm package links and the vanilla @cometchat/cards bullet (no docs guide to point to). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Update the React row in the render note to /ui-kit/react/v7/card-messages (current React UI Kit major) instead of v6. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a dedicated JavaScript SDK "Card Messages" page covering the three receive-only card mechanisms: standalone CardMessage (onCardMessageReceived), inline cards on AIAssistantMessage via getElements()/AIAssistantElement, and real-time card streaming events (card_start/card/card_end) on the AIAssistantListener.
Description
Related Issue(s)
Type of Change
Checklist
Additional Information
Screenshots (if applicable)