Skip to content

docs(js-sdk): document card message support (ENG-36071)#420

Merged
ketanyekale merged 7 commits into
mainfrom
feature/ENG-36071-js-sdk-card-messages-docs
Jul 6, 2026
Merged

docs(js-sdk): document card message support (ENG-36071)#420
ketanyekale merged 7 commits into
mainfrom
feature/ENG-36071-js-sdk-card-messages-docs

Conversation

@aanshisingh-cometchat

Copy link
Copy Markdown
Contributor

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)

Description

Related Issue(s)

Type of Change

  • Documentation correction/update
  • New documentation
  • Improvement to existing documentation
  • Typo fix
  • Other (please specify)

Checklist

  • I have read the CONTRIBUTING document
  • My branch name follows the naming convention
  • My changes follow the documentation style guide
  • I have checked for spelling and grammar errors
  • All links in my changes are valid and working
  • My changes are accurately described in this pull request

Additional Information

Screenshots (if applicable)

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>
@mintlify

mintlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cometchat 🟢 Ready View Preview Jul 2, 2026, 4:12 PM

…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>
@jitvarpatil

Copy link
Copy Markdown
Contributor

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

  • CardMessageextends BaseMessage, with getCard(): Object|undefined, getText(): string, getFallbackText(): string, getTags(): Array<String> — all match the docs.
  • onCardMessageReceived(message: CometChat.CardMessage) — real MessageListener callback (dispatched in WSConnectionHelper.ts:843); added correctly to the listener table and examples in all-real-time-listeners.mdx.
  • Card streaming eventsAIAssistantCardStartedEvent, AIAssistantCardReceivedEvent, AIAssistantCardEndedEvent, and AIAssistantElement are 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.mdx correctly states JS card support is receive-only; the sdk/reference/messages.mdx reference is comprehensive and consistent.
  • Structure: new card-messages.mdx wired 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).

jitvarpatil
jitvarpatil previously approved these changes Jul 6, 2026

@jitvarpatil jitvarpatil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • CardMessageextends BaseMessage, with getCard(): Object|undefined, getText(): string, getFallbackText(): string, getTags(): Array<String> — all match the docs.
  • onCardMessageReceived(message: CometChat.CardMessage) — real MessageListener callback (dispatched in WSConnectionHelper.ts:843); added correctly to the listener table and examples in all-real-time-listeners.mdx.
  • Card streaming eventsAIAssistantCardStartedEvent, AIAssistantCardReceivedEvent, AIAssistantCardEndedEvent, and AIAssistantElement are 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.mdx correctly states JS card support is receive-only; the sdk/reference/messages.mdx reference is comprehensive and consistent.
  • Structure: new card-messages.mdx wired 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>
raj-dubey1
raj-dubey1 previously approved these changes Jul 6, 2026
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>
@ketanyekale ketanyekale merged commit c381203 into main Jul 6, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants