From 74ebc1029029e4e905c5816b4f6ecdacf4ec82ff Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:49:22 +0530 Subject: [PATCH 01/23] docs(react): say how 1:1 calls ring on the Calls SDK 5.1 flow Call Features gets a "How calls ring" section: 1:1 calls ring through the Calls SDK, the caller's screen reads "Outgoing Call" then "Ringing...", the callee's other tabs and devices stop when one answers or declines, the caller gives up as unanswered after 45 s, and a busy tab answers a new call busy. Group calls still send a meeting message. A subsection says what Connect legacy ringing does and what happens while it's off, and links to the Calls docs instead of repeating them. The install line asks for the Calls SDK 5.1.1, which 1:1 calls need; on 5.0.x they fail with CALLS_SDK_UNAVAILABLE. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/call-features.mdx | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/ui-kit/react/call-features.mdx b/ui-kit/react/call-features.mdx index 73ec76530..d5c297c37 100644 --- a/ui-kit/react/call-features.mdx +++ b/ui-kit/react/call-features.mdx @@ -7,11 +7,12 @@ description: "Overview of CometChat React UI Kit calling features, including inc | Field | Value | | --- | --- | -| Packages | `@cometchat/chat-uikit-react` + `@cometchat/calls-sdk-javascript` (`npm install @cometchat/calls-sdk-javascript`) | +| Packages | `@cometchat/chat-uikit-react` + `@cometchat/calls-sdk-javascript` 5.1.1 or later (`npm install @cometchat/calls-sdk-javascript@^5.1.1`) | | Required setup | Call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` during init — Calls SDK must also be installed | | Call features | Incoming Call, Outgoing Call, Call Logs, Call Buttons (in Message Header) | | Key components | `CometChatMessageHeader` → [Message Header](/ui-kit/react/components/message-header) (includes call buttons), `CometChatIncomingCall` → [Incoming Call](/ui-kit/react/components/incoming-call), `CometChatOutgoingCall` → [Outgoing Call](/ui-kit/react/components/outgoing-call), `CometChatCallLogs` → [Call Logs](/ui-kit/react/components/call-logs) | | Enabling | Set `.setCallingEnabled(true)` on `UIKitSettingsBuilder` to activate call UI components | +| How 1:1 calls ring | Through the Calls SDK 5.1 ringing flow; group calls send a meeting message. See [How calls ring](#how-calls-ring) | | CSS class prefix | `.cometchat-` | @@ -28,10 +29,15 @@ Ensure you have called `CometChatUIKit.init()` with `.setCallingEnabled(true)` a Install the Calls SDK and enable calling: +{/* TODO(release): the first Calls SDK release with the fix the UI Kit needs. */} ```bash lines -npm install @cometchat/calls-sdk-javascript +npm install @cometchat/calls-sdk-javascript@^5.1.1 ``` + +1:1 calls need the Calls SDK 5.1.1 or later. On 5.0.x, every 1:1 call fails with the error `CALLS_SDK_UNAVAILABLE`. + + Then set `.setCallingEnabled(true)` on your `UIKitSettingsBuilder`: ```tsx @@ -52,6 +58,24 @@ Call buttons render inside [MessageHeader](/ui-kit/react/components/message-head +## How calls ring + +1:1 calls ring through the Calls SDK, on its [ringing flow](/calls/javascript/ringing). The kit places, answers, declines and cancels them, so the app writes no ringing code: + +- The caller's screen reads "Outgoing Call", then "Ringing..." once the callee's device rings. +- The callee sees the [Incoming Call](/ui-kit/react/components/incoming-call) card. When one of the callee's tabs or devices answers or declines, the others stop ringing. +- If nobody answers within 45 seconds, the caller's kit ends the call as unanswered. +- A tab that is already in a call, placing one or ringing for one answers a new 1:1 call busy, without showing it. + +Group calls don't ring. The kit sends a meeting message to the group, and members join the call from it. + +### The Connect legacy ringing setting + +**Connect legacy ringing**, in the dashboard under **Voice & Video Calls → Settings**, also sends calls on this flow as legacy call events. Turn it on while some of your users are on apps on legacy ringing, such as an older UI Kit or a mobile app that doesn't ring with the Calls SDK 5.1 and the Push Notifications SDK 2.0; see [While some users are still on legacy ringing](/calls/javascript/migrating-from-legacy-ringing#while-some-users-are-still-on-legacy-ringing). While it's off: + +- An app on legacy ringing that is called keeps ringing after the caller cancels. +- A decline, a cancel or no answer shows on the other side a few seconds late. The kit learns of it by reading the call's status every 3 seconds while the call rings, and from the call's messages once it ends. + ## Features ### Incoming Call From efcc40a12d2978edfb6108a6a509b2b77c28520a Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:49:22 +0530 Subject: [PATCH 02/23] docs(react): raise the Chat SDK and Calls SDK floors for 7.3 The overview, the four integration pages and the migration guide now give the Chat SDK peer as ^4.2.1 and the Calls SDK peer as ^5.1.1, and name 7.3 as the release that needs them. The version notes add the 7.3.0 floor and link to How calls ring for why the Calls SDK floor rose. The release versions are placeholders until the Calls SDK and UI Kit releases ship. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/integration-astro.mdx | 4 ++-- ui-kit/react/integration-nextjs.mdx | 4 ++-- ui-kit/react/integration-react-router.mdx | 4 ++-- ui-kit/react/integration-react.mdx | 4 ++-- ui-kit/react/migration-overview.mdx | 13 +++++++------ ui-kit/react/overview.mdx | 12 +++++++----- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/ui-kit/react/integration-astro.mdx b/ui-kit/react/integration-astro.mdx index 6163d3a48..d06775091 100644 --- a/ui-kit/react/integration-astro.mdx +++ b/ui-kit/react/integration-astro.mdx @@ -9,14 +9,14 @@ description: "Add CometChat to an Astro app in 5 steps: create project, install, | Field | Value | | --- | --- | | Package | `@cometchat/chat-uikit-react` v7.x | -| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.0; optional `@cometchat/calls-sdk-javascript` ^5.0.3 (calling only) | +| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.1; optional `@cometchat/calls-sdk-javascript` ^5.1.1 (calling only) | | Bundled deps | `dompurify`, `@cometchat/cards-react` — regular dependencies, installed automatically. Do not add them yourself | | Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` | | Login | `CometChatUIKit.login("UID")` — must resolve before rendering components | | Order | `init()` → `login()` → render ``. Breaking this order = blank screen | | Auth Key | Dev/testing only. Use Auth Token in production | | SSR | Use `client:only="react"` directive — CometChat components cannot be server-rendered | -| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | +| Calling | Optional. Install `@cometchat/calls-sdk-javascript` (5.1.1 or later) and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | | Other frameworks | [React.js](/ui-kit/react/integration-react) · [Next.js](/ui-kit/react/integration-nextjs) · [React Router](/ui-kit/react/integration-react-router) | diff --git a/ui-kit/react/integration-nextjs.mdx b/ui-kit/react/integration-nextjs.mdx index 3f4866176..2a304e742 100644 --- a/ui-kit/react/integration-nextjs.mdx +++ b/ui-kit/react/integration-nextjs.mdx @@ -9,14 +9,14 @@ description: "Add CometChat to a Next.js (App Router) app in 5 steps: create pro | Field | Value | | --- | --- | | Package | `@cometchat/chat-uikit-react` v7.x | -| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.0; optional `@cometchat/calls-sdk-javascript` ^5.0.3 (calling only) | +| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.1; optional `@cometchat/calls-sdk-javascript` ^5.1.1 (calling only) | | Bundled deps | `dompurify`, `@cometchat/cards-react` — regular dependencies, installed automatically. Do not add them yourself | | Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` | | Login | `CometChatUIKit.login("UID")` — must resolve before rendering components | | Order | `init()` → `login()` → render ``. Breaking this order = blank screen | | Auth Key | Dev/testing only. Use `loginWithAuthToken` in production | | SSR | CometChat components must be loaded with `dynamic(() => import(...), { ssr: false })` | -| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | +| Calling | Optional. Install `@cometchat/calls-sdk-javascript` (5.1.1 or later) and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | | Other frameworks | [React.js](/ui-kit/react/integration-react) · [React Router](/ui-kit/react/integration-react-router) · [Astro](/ui-kit/react/integration-astro) | diff --git a/ui-kit/react/integration-react-router.mdx b/ui-kit/react/integration-react-router.mdx index 0dfa7d272..716f6a61d 100644 --- a/ui-kit/react/integration-react-router.mdx +++ b/ui-kit/react/integration-react-router.mdx @@ -9,14 +9,14 @@ description: "Add CometChat to a React Router app in 5 steps: create project, in | Field | Value | | --- | --- | | Package | `@cometchat/chat-uikit-react` v7.x | -| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.0; optional `@cometchat/calls-sdk-javascript` ^5.0.3 (calling only) | +| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.1; optional `@cometchat/calls-sdk-javascript` ^5.1.1 (calling only) | | Bundled deps | `dompurify`, `@cometchat/cards-react` — regular dependencies, installed automatically. Do not add them yourself | | Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` | | Login | `CometChatUIKit.login("UID")` — must resolve before rendering components | | Order | `init()` → `login()` → render ``. Breaking this order = blank screen | | Auth Key | Dev/testing only. Use Auth Token in production | | SSR | N/A — client-side SPA by default | -| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | +| Calling | Optional. Install `@cometchat/calls-sdk-javascript` (5.1.1 or later) and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | | Other frameworks | [React.js](/ui-kit/react/integration-react) · [Next.js](/ui-kit/react/integration-nextjs) · [Astro](/ui-kit/react/integration-astro) | diff --git a/ui-kit/react/integration-react.mdx b/ui-kit/react/integration-react.mdx index 6fcdb00f2..7bbdbb0eb 100644 --- a/ui-kit/react/integration-react.mdx +++ b/ui-kit/react/integration-react.mdx @@ -9,13 +9,13 @@ description: "Add CometChat to a React.js app in 4 steps: create project, instal | Field | Value | | --- | --- | | Package | `@cometchat/chat-uikit-react` v7.x | -| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.0; optional `@cometchat/calls-sdk-javascript` ^5.0.3 (calling only) | +| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.1; optional `@cometchat/calls-sdk-javascript` ^5.1.1 (calling only) | | Bundled deps | `dompurify`, `@cometchat/cards-react` — regular dependencies, installed automatically. Do not add them yourself | | Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` | | Login | `CometChatUIKit.login("UID")` — must resolve before rendering components | | Order | `init()` → `login()` → render ``. Breaking this order = blank screen | | Auth Key | Dev/testing only. Use Auth Token in production | -| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | +| Calling | Optional. Install `@cometchat/calls-sdk-javascript` (5.1.1 or later) and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | | Other frameworks | [Next.js](/ui-kit/react/integration-nextjs) · [React Router](/ui-kit/react/integration-react-router) · [Astro](/ui-kit/react/integration-astro) | diff --git a/ui-kit/react/migration-overview.mdx b/ui-kit/react/migration-overview.mdx index e066c8bf0..dc0d799f5 100644 --- a/ui-kit/react/migration-overview.mdx +++ b/ui-kit/react/migration-overview.mdx @@ -10,7 +10,7 @@ description: "Migration guide covering breaking changes, architecture shifts, an | --- | --- | | Package | `@cometchat/chat-uikit-react` v6 → v7 | | React minimum | `>=18.0.0 <21.0.0` | -| SDK peer dep | `@cometchat/chat-sdk-javascript` ^4.2.0 (required by 7.2.x) | +| SDK peer dep | `@cometchat/chat-sdk-javascript` ^4.2.1 (required by 7.3.x) | | Bundled deps | `dompurify` (new in v7) and `@cometchat/cards-react` (already a dependency since 6.5.0) — installed automatically, not peer deps | | Removed dep | `rxjs` (no longer needed) | | Stylesheet | Delete the v6 `css-variables.css` import — v7 loads its own styles | @@ -41,25 +41,26 @@ v7 is a ground-up rewrite that replaces global singletons with React-native patt ### 1. Update Dependencies +{/* TODO(release): the first Calls SDK release with the fix the UI Kit needs, and the UI Kit release that needs it. */} ```bash -npm install @cometchat/chat-uikit-react@7 @cometchat/chat-sdk-javascript@^4.2.0 +npm install @cometchat/chat-uikit-react@7 @cometchat/chat-sdk-javascript@^4.2.1 npm uninstall rxjs # No longer needed for CometChat ``` | Package | v6 | v7 | | --- | --- | --- | -| `@cometchat/chat-uikit-react` | `^6.x` | `^7.2.4` | -| `@cometchat/chat-sdk-javascript` | `^4.x` | `^4.2.0` — peer dep, required by 7.2.x | +| `@cometchat/chat-uikit-react` | `^6.x` | `^7.3.0` | +| `@cometchat/chat-sdk-javascript` | `^4.x` | `^4.2.1` — peer dep, required by 7.3.x | | `react` | `>=18` | `>=18 <21` | | `rxjs` | Required | Not needed — uninstall it | -| `@cometchat/calls-sdk-javascript` | Optional | Optional (unchanged) | +| `@cometchat/calls-sdk-javascript` | Optional | Optional; `^5.1.1` for calling — see [How calls ring](/ui-kit/react/call-features#how-calls-ring) | | `dompurify` | — | Bundled — do **not** install it yourself | | `@cometchat/cards-react` | Bundled (since 6.5.0) | Bundled — do **not** install it yourself | `dompurify` and `@cometchat/cards-react` are regular dependencies of the UI Kit, so npm pulls them in automatically. They are not peer dependencies and do not belong in your `package.json`. -Bump your SDK first. 7.2.x declares `@cometchat/chat-sdk-javascript` `^4.2.0`, so staying on a 4.1.x pin fails with `ERESOLVE` — `^4` is not sufficient. Installing `^4.2.0` is safe on every v7 release, including 7.0.x and 7.1.x, whose ranges it also satisfies. +Bump your SDK first. 7.3.x declares `@cometchat/chat-sdk-javascript` `^4.2.1`, so a pin below 4.2.1 fails with `ERESOLVE` — `^4` is not sufficient. Installing `^4.2.1` is safe on every v7 release, including 7.0.x, 7.1.x and 7.2.x, whose ranges it also satisfies. **Delete your v6 stylesheet import.** v6 required you to import the base stylesheet yourself: diff --git a/ui-kit/react/overview.mdx b/ui-kit/react/overview.mdx index 0e05a1456..515fc5933 100644 --- a/ui-kit/react/overview.mdx +++ b/ui-kit/react/overview.mdx @@ -9,7 +9,7 @@ description: "Prebuilt React components for chat, voice, and video calling. Supp | Field | Value | | --- | --- | | Package | `@cometchat/chat-uikit-react` v7.x | -| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.0; optional `@cometchat/calls-sdk-javascript` ^5.0.3 (calling only) | +| Peer deps | `react` `>=18 <21`, `react-dom` `>=18 <21`, `@cometchat/chat-sdk-javascript` ^4.2.1; optional `@cometchat/calls-sdk-javascript` ^5.1.1 (calling only) | | Bundled deps | `dompurify`, `@cometchat/cards-react` — regular dependencies, installed automatically. Do not add them yourself | | Calling | Optional — `@cometchat/calls-sdk-javascript` | | SSR | SSR-safe — no browser APIs at module scope. Next.js App Router compatible. | @@ -90,20 +90,22 @@ You can find these values in the [CometChat Dashboard](https://app.cometchat.com npm install @cometchat/chat-uikit-react @cometchat/chat-sdk-javascript react react-dom ``` +{/* TODO(release): the first Calls SDK release with the fix the UI Kit needs, and the UI Kit release that needs it. */} + | Package | Version | Install | |---------|---------|---------| -| `@cometchat/chat-uikit-react` | `^7.2.4` (latest) | Yes | -| `@cometchat/chat-sdk-javascript` | `^4.2.0` | Yes — peer dependency | +| `@cometchat/chat-uikit-react` | `^7.3.0` (latest) | Yes | +| `@cometchat/chat-sdk-javascript` | `^4.2.1` | Yes — peer dependency | | `react` | `>=18.0.0 <21.0.0` | Yes — peer dependency | | `react-dom` | `>=18.0.0 <21.0.0` | Yes — peer dependency | -| `@cometchat/calls-sdk-javascript` | `^5.0.3` | Only for voice/video calling — optional peer dependency | +| `@cometchat/calls-sdk-javascript` | `^5.1.1` | Only for voice/video calling — optional peer dependency | | `dompurify` | `3.3.1` | No — bundled as a regular dependency | | `@cometchat/cards-react` | `~1.0.0` | No — bundled as a regular dependency | `dompurify` and `@cometchat/cards-react` are regular dependencies of the UI Kit, not peer dependencies, so npm installs them for you. Adding them to your own `package.json` is unnecessary and risks pinning a version the UI Kit was not tested against. -The versions above are correct as of `@cometchat/chat-uikit-react@7.2.x`, and `@cometchat/chat-sdk-javascript` `^4.2.0` also satisfies every earlier 7.x release, so it is safe whichever v7 version you are on. If you are pinned to an older SDK for unrelated reasons, the floor rises per release: 7.0.3 needs 4.1.12, 7.1.0 needs 4.1.13 and 7.2.x needs 4.2.0. The authoritative range is always the `peerDependencies` block of the version you install — check it with `npm view @cometchat/chat-uikit-react@ peerDependencies`. +The versions above are correct as of `@cometchat/chat-uikit-react@7.3.x`, and `@cometchat/chat-sdk-javascript` `^4.2.1` also satisfies every earlier 7.x release, so it is safe whichever v7 version you are on. If you are pinned to an older SDK for unrelated reasons, the floor rises per release: 7.0.3 needs 4.1.12, 7.1.0 needs 4.1.13, 7.2.x needs 4.2.0 and 7.3.0 needs 4.2.1. 7.3.0 also raises the Calls SDK floor to 5.1.1, because 1:1 calls now ring through the Calls SDK; see [How calls ring](/ui-kit/react/call-features#how-calls-ring). The authoritative range is always the `peerDependencies` block of the version you install — check it with `npm view @cometchat/chat-uikit-react@ peerDependencies`. --- From 486cb45ca87322c889a4eba1894bca6bf0bede45 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:51:49 +0530 Subject: [PATCH 03/23] docs(react): bring the calling integration guide to the ringing flow Step 1 installs the Calls SDK 5.1.1, which 1:1 calls need. Step 3 says how 1:1 call settings work now: laid over the kit's defaults when the call is placed or starts ringing, with sessionType from the button and isPeerCall on, and not changed by settings given later. Step 5 describes "Outgoing Call", then "Ringing...". Step 7's example passed an onAccept that only logged, which now leaves the call unanswered (and before, skipped acceptCall). It now says to leave onAccept and onDecline unset, to listen for ui:call/accepted and ui:call/rejected to run code, and shows an onAccept that joins the prepared session with CometChatOngoingCall. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/calling-integration.mdx | 61 +++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/ui-kit/react/calling-integration.mdx b/ui-kit/react/calling-integration.mdx index cc0e1377b..1ad7f67f5 100644 --- a/ui-kit/react/calling-integration.mdx +++ b/ui-kit/react/calling-integration.mdx @@ -15,24 +15,29 @@ By the end of this guide you will have voice and video calling working in your R ## Step 1: Install the Calls SDK -The calling feature requires the optional `@cometchat/calls-sdk-javascript` peer dependency: +The calling feature requires the optional `@cometchat/calls-sdk-javascript` peer dependency, 5.1.1 or later: +{/* TODO(release): the first Calls SDK release with the fix the UI Kit needs. */} ```bash npm -npm install @cometchat/calls-sdk-javascript +npm install @cometchat/calls-sdk-javascript@^5.1.1 ``` ```bash yarn -yarn add @cometchat/calls-sdk-javascript +yarn add @cometchat/calls-sdk-javascript@^5.1.1 ``` ```bash pnpm -pnpm add @cometchat/calls-sdk-javascript +pnpm add @cometchat/calls-sdk-javascript@^5.1.1 ``` + +1:1 calls ring through the Calls SDK 5.1 ringing flow, so they need 5.1.1 or later. On 5.0.x, every 1:1 call fails with the error `CALLS_SDK_UNAVAILABLE`. See [How calls ring](/ui-kit/react/call-features#how-calls-ring). + + This package provides the WebRTC layer for voice and video calls. It is loaded lazily by the UI Kit — no additional bundle cost until calling is actually used. ## Step 2: Enable Calling in UIKitSettingsBuilder @@ -71,6 +76,20 @@ The Calls SDK uses the same `appId` and `region` from your `UIKitSettings` — n The `config` prop on `CometChatProvider` accepts a `CometChatGlobalConfig` object for UI/behavior flags (`hideReceipts`, `hideUserStatus`, `disableSoundForCalls`, `customSoundForCalls`, `callSettingsBuilder`). It does **not** take a separate calling app ID or region. +### Settings for 1:1 calls + +A 1:1 call's session is set up when the call is placed, on the caller's side, and when it starts ringing, on the callee's. At that moment the kit lays `callSettingsBuilder` over its own defaults, so set only what you want to change: + +```tsx + + {/* your app */} + +``` + +- `sessionType` comes from the button pressed (voice or video), and `isPeerCall` is always on, so a hang-up ends the call for both people. +- Settings given later, for example to your own `CometChatOngoingCall`, don't reach a call that is already set up. +- Group calls are unchanged: their settings replace the defaults. + ## Step 4: Add Call Buttons via CometChatMessageHeader `CometChatMessageHeader` automatically renders voice and video call buttons when calling is enabled. No extra configuration needed — just render the header with a `user` or `group`: @@ -116,7 +135,7 @@ With the setup complete, test a voice call: 1. Open your app with two different users in separate browser tabs 2. Click the **voice call** button (phone icon) in the chat header -3. The caller sees the `CometChatOutgoingCall` screen with a "Calling..." indicator +3. The caller sees the `CometChatOutgoingCall` screen. It reads "Outgoing Call", then "Ringing..." once the receiver's device rings 4. The receiver sees the `CometChatIncomingCall` overlay with accept/reject buttons 5. Once accepted, both users enter the `CometChatOngoingCall` view with live audio @@ -223,22 +242,42 @@ export default function App() { } ``` -`CometChatIncomingCall` listens for incoming call events and displays an accept/reject overlay. When the user accepts, it transitions to the `CometChatOngoingCall` screen internally. You can customize its behavior with callbacks: +`CometChatIncomingCall` listens for incoming call events and displays an accept/reject overlay. When the user accepts, the kit answers the call and opens the `CometChatOngoingCall` screen; when the user declines, the kit declines the call. Leave `onAccept` and `onDecline` unset for that. To run your own code when the user answers or declines, listen for the `ui:call/accepted` and `ui:call/rejected` events instead; see [Events](/ui-kit/react/event-system#call-actions). + +Pass `onAccept` only to draw the call screen yourself. The kit then stops ringing and hands your app the session it prepared while the call rang. Join it with `CometChatOngoingCall`: ```tsx - console.log("Call accepted:", call)} - onDecline={(call) => console.log("Call declined:", call)} -/> +import { useState } from "react"; +import { CometChat } from "@cometchat/chat-sdk-javascript"; +import { CometChatIncomingCall, CometChatOngoingCall } from "@cometchat/chat-uikit-react"; + +function Calls() { + const [call, setCall] = useState(null); + + return ( + <> + + {call && ( + setCall(null)} + /> + )} + + ); +} ``` +The call's settings were fixed when it started ringing (see Step 3), so `callSettings` passed to this `CometChatOngoingCall` don't apply. Pass `onDecline` only if your app declines the call itself: the kit then just stops ringing and leaves the session it prepared, which ends a 1:1 call for the caller as unanswered. + `CometChatOutgoingCall` is rendered automatically by the `CometChatCallButtons` component when the user initiates a call — you do not need to place it manually. ## Summary | Step | Action | |------|--------| -| 1 | Install `@cometchat/calls-sdk-javascript` | +| 1 | Install `@cometchat/calls-sdk-javascript` 5.1.1 or later | | 2 | Set `.setCallingEnabled(true)` on `UIKitSettingsBuilder` | | 3 | (Optional) Configure call behavior via `config` prop on `CometChatProvider` | | 4 | Call buttons appear in `CometChatMessageHeader` automatically | From 6a36325e11dbb4be6f5f6aae828b408a8cc25c96 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:53:14 +0530 Subject: [PATCH 04/23] docs(react): describe the call buttons on the ringing flow The listener table listed Chat SDK events a ringing call never fires. It now lists what the buttons follow: the placed call's Calls SDK session, the 3 s status read and the incoming ring, with the Chat SDK's events left for calls from apps on legacy ringing and for Connect legacy ringing. Call Settings and its prop say that 1:1 settings are laid over the kit's defaults when the call is placed, while group settings still replace them. A note on the click overrides points apps that draw their own call screens at useCometChatCallButtons. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/components/call-buttons.mdx | 33 ++++++++++++++---------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/ui-kit/react/components/call-buttons.mdx b/ui-kit/react/components/call-buttons.mdx index 2d8ea8280..01a0111c3 100644 --- a/ui-kit/react/components/call-buttons.mdx +++ b/ui-kit/react/components/call-buttons.mdx @@ -16,7 +16,7 @@ description: "Voice and video call buttons for user or group conversations, with | Stitching | Pass `user` or `group`; the buttons manage the outgoing/ongoing call lifecycle internally (see [Calling Integration](/ui-kit/react/calling-integration)) | | Events emitted | `ui:call/outgoing`, `ui:message/sent` — see [Event System](/ui-kit/react/event-system) | | Events received | `ui:call/rejected`, `ui:call/ended` — see [Event System](/ui-kit/react/event-system) | -| SDK listeners (automatic) | Incoming call events (received/cancelled) and outgoing call events (accepted/rejected) to sync button state and screen transitions | +| Listeners (automatic) | The placed call's Calls SDK session and a status read every 3 s while it rings; the incoming call ring, to disable the buttons — see [Listeners](#listeners-real-time-automatic) | | Full props | See [Props](#props) | @@ -137,6 +137,10 @@ function CallButtonsVideoOverride() { } ``` + +With `onVoiceCallClick` or `onVideoCallClick` set, the kit doesn't place the call, so it doesn't ring it either. To keep the kit's ringing and draw the call screens yourself, use the `useCometChatCallButtons` hook instead; see [Custom Call Screens](/ui-kit/react/custom-call-screens). + + #### onCallEnded Fires after an ongoing call session ends and the component has reset its internal state. @@ -195,22 +199,24 @@ UI events this component subscribes to (published by other components): | `ui:call/rejected` | `{ call }` | Clears the active call and re-enables the buttons | | `ui:call/ended` | `{}` | Clears the active call and resets all call state | -### SDK Listeners (Real-Time, Automatic) +### Listeners (Real-Time, Automatic) -The component attaches SDK call listeners internally: +A 1:1 call rings through the Calls SDK (see [How calls ring](/ui-kit/react/call-features#how-calls-ring)), so the component follows the call it placed through the Calls SDK: -| SDK Listener | Internal behavior | +| Source | Internal behavior | | --- | --- | -| `onIncomingCallReceived` | Disables call buttons to prevent concurrent calls | -| `onIncomingCallCancelled` | Re-enables call buttons | -| `onOutgoingCallAccepted` | Transitions to the ongoing call screen | -| `onOutgoingCallRejected` | Clears the active call and resets state | +| The call's Calls SDK session: `onParticipantConnected` | Shows "Ringing..." on the outgoing call screen | +| The call's Calls SDK session: `onParticipantJoined` | Transitions to the ongoing call screen | +| The call's Calls SDK session: `onConnectionClosed`, and a read of the call's status every 3 seconds while it rings | Closes the outgoing call screen when the call is declined, busy, cancelled or not answered | +| An incoming call ringing on the [Incoming Call](/ui-kit/react/components/incoming-call) card | Disables the buttons until the ring stops, to prevent concurrent calls | + +The Chat SDK's `CallListener` still covers the rest: `onIncomingCallReceived` and `onIncomingCallCancelled` disable and re-enable the buttons for a call from an app on legacy ringing, and `onOutgoingCallAccepted` and `onOutgoingCallRejected` arrive only when **Connect legacy ringing** is on. --- ## Call Settings -Customize the calling experience via `callSettingsBuilder`. In v7 this prop takes a session-settings **object** (`SessionSettings`), not a function: `CometChatCallButtons` passes it unchanged to the internal `CometChatOngoingCall` as its `callSettings`. +Customize the calling experience via `callSettingsBuilder`. In v7 this prop takes a session-settings **object** (`SessionSettings`), not a function. ```tsx import type { User } from "@cometchat/chat-sdk-javascript"; @@ -226,9 +232,10 @@ function CallButtonsCustomSettings({ chatUser }: { chatUser: User }) { } ``` - -The object replaces the built-in defaults, including the `sessionType` the component would pick for a voice call (`"VOICE"`). Set `sessionType` yourself if the same settings must also serve voice calls, or hide the button that doesn't match. - +How the object is used depends on the call: + +- **1:1 calls:** the session is set up when the call is placed, and the kit lays the object over its own defaults, so set only what you change. `sessionType` comes from the button pressed, and `isPeerCall` is always on, so a hang-up ends the call for both people. Settings given later, for example to your own `CometChatOngoingCall`, don't reach the call. +- **Group calls:** `CometChatCallButtons` passes the object unchanged to the internal `CometChatOngoingCall` as its `callSettings`. It replaces the built-in defaults, including the `sessionType` the component would pick for a voice call (`"VOICE"`). Set `sessionType` yourself if the same settings must also serve voice calls, or hide the button that doesn't match. --- @@ -357,7 +364,7 @@ All props are optional. Sorted alphabetically. ### callSettingsBuilder -Session settings for the ongoing call this component starts, passed unchanged to `CometChatOngoingCall` as `callSettings` (it replaces the built-in defaults). Falls back to `GlobalConfig.callSettingsBuilder`. See [Calling Integration](/ui-kit/react/calling-integration) for call-settings setup. +Session settings for the call this component starts. For a 1:1 call they are laid over the kit's defaults when the call is placed; for a group call they are passed unchanged to `CometChatOngoingCall` as `callSettings`, replacing the defaults. Falls back to `GlobalConfig.callSettingsBuilder`. See [Call Settings](#call-settings). | | | | --- | --- | From 87488f3464e699d8307c35f94d096b48680c4a59 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:54:17 +0530 Subject: [PATCH 05/23] docs(react): give the incoming call card's callbacks their new meaning On the ringing flow, onAccept no longer replaces CometChat.acceptCall: the kit stops ringing and hands the app the prepared session to join with CometChatOngoingCall or useOngoingCall. onDecline makes the kit only stop ringing and leave that session, which ends a 1:1 call for the caller as unanswered. Both pages say to leave them unset and listen for ui:call/accepted and ui:call/rejected instead, and the first example no longer passes callbacks that only log. The callSettingsBuilder warning said the builder is never applied. It is now applied to ringing calls, laid over the kit's defaults when the call starts ringing; it is still not applied to a call from an app on legacy ringing. The listener section describes the ringing flow, and the page lists ui:call/accepted and the translated Accept and Decline. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/components/incoming-call.mdx | 52 ++++++++++++----------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/ui-kit/react/components/incoming-call.mdx b/ui-kit/react/components/incoming-call.mdx index 26bbe0504..825c0348d 100644 --- a/ui-kit/react/components/incoming-call.mdx +++ b/ui-kit/react/components/incoming-call.mdx @@ -11,11 +11,11 @@ description: "Displays an incoming call notification with caller info, accept/de | Package | `@cometchat/chat-uikit-react` | | Import | `import { CometChatIncomingCall } from "@cometchat/chat-uikit-react";` | | CSS root class | `.cometchat-incoming-call` | -| Primary output | `onAccept: (call: Call) => void` — fires when the call is accepted | +| Primary output | Answers and declines incoming calls; `onAccept` / `onDecline` take that over | | Prerequisites | App wrapped in [`CometChatProvider`](/ui-kit/react/cometchat-provider) with valid credentials + a logged-in user | -| Stitching | Mount at the app root to catch incoming calls; wire `onAccept` / `onDecline` | -| Events emitted | `ui:call/rejected`, `ui:call/ended` — see [Event System](/ui-kit/react/event-system) | -| SDK listeners (automatic) | Incoming and outgoing call lifecycle — handled internally | +| Stitching | Mount once at the app root to catch incoming calls; leave `onAccept` / `onDecline` unset to let the kit answer and decline | +| Events emitted | `ui:call/accepted`, `ui:call/rejected`, `ui:call/ended` — see [Event System](/ui-kit/react/event-system) | +| Listeners (automatic) | The Chat SDK's `CallListener` for the incoming call, then the call's Calls SDK session and a status read every 3 s while a 1:1 call rings — handled internally | | Full props | See [Props](#props) | @@ -41,8 +41,9 @@ description: "Displays an incoming call notification with caller info, accept/de The component handles: - Automatic detection of incoming calls via SDK `CallListener` - Caller avatar, name, and call type display (Voice/Video) -- Accept button — transitions to `CometChatOngoingCall` internally -- Decline button — rejects the call via SDK +- Accept button — answers the call and transitions to `CometChatOngoingCall` internally +- Decline button — declines the call. The user's other tabs and devices stop ringing. A group call only stops ringing here: it goes on for the group's other members +- Accept and Decline labels in the user's language (`incoming_call_confirm_yes`, `incoming_call_confirm_no`) - Incoming call sound playback (looping while notification is visible) - Self-managed visibility (renders nothing when no incoming call is active) @@ -64,12 +65,6 @@ function App() {
{/* Your app content */} { - console.log("Call accepted:", call.getSessionId()); - }} - onDecline={(call) => { - console.log("Call declined:", call.getSessionId()); - }} onCallEnded={() => { console.log("Call ended"); }} @@ -79,6 +74,8 @@ function App() { } ``` +Leave `onAccept` and `onDecline` unset to let the kit answer and decline. Passing them takes that over; see [onAccept](#onaccept) and [onDecline](#ondecline). + ### Full Layout Example ```tsx @@ -119,8 +116,8 @@ function ChatApp() { | Prop | Signature | Fires when | | --- | --- | --- | -| `onAccept` | `(call: Call) => void` | User clicks the accept button | -| `onDecline` | `(call: Call) => void` | User clicks the decline button | +| `onAccept` | `(call: Call) => void` | User clicks the accept button; the app then joins the call itself | +| `onDecline` | `(call: Call) => void` | User clicks the decline button; the app then declines the call itself | | `onCallEnded` | `() => void` | Ongoing call session ends | | `onError` | `((error: CometChatException) => void) \| null` | SDK error occurs | @@ -130,6 +127,7 @@ UI events this component publishes: | Event | Payload | Fires when | | --- | --- | --- | +| `ui:call/accepted` | `{ call }` | Call answered by user | | `ui:call/rejected` | `{ call }` | Call declined by user | | `ui:call/ended` | `{}` | Ongoing call ended | @@ -137,14 +135,14 @@ UI events this component publishes: This component does not subscribe to any UI events from other components. -### SDK Listeners (Automatic) +### Listeners (Automatic) + +The component learns of an incoming call from the Chat SDK's `CallListener` (`onIncomingCallReceived`) and shows the notification. A 1:1 call on the ringing flow (see [How calls ring](/ui-kit/react/call-features#how-calls-ring)) then rings through the Calls SDK: -These SDK `CallListener` callbacks are attached internally. The component updates its state automatically: +- The component prepares the call's session while it rings, so Accept joins at once. +- It hides the notification when the caller cancels, when the call is answered or declined in another tab or device, or when nobody answers. It learns this from the session's `onConnectionClosed`, from a read of the call's status every 3 seconds, and from its own 60-second limit. -- `onIncomingCallReceived` — shows the incoming call notification -- `onIncomingCallCancelled` — hides the notification (caller cancelled) -- `onOutgoingCallAccepted` — transitions to ongoing call screen -- `onOutgoingCallRejected` — hides the notification (call rejected elsewhere) +A call from an app on legacy ringing still follows the Chat SDK's `onIncomingCallCancelled`, `onOutgoingCallAccepted` and `onOutgoingCallRejected`. --- @@ -277,7 +275,9 @@ All props are optional. `Call` and `CometChatException` in the types below are t ### onAccept -Custom accept handler. When provided, overrides the default `CometChat.acceptCall` behavior. +Custom accept handler. When provided, the kit doesn't answer the call: it stops ringing and hands your app the session it prepared while the call rang. Join it with `CometChatOngoingCall` (or `useOngoingCall`); see the example in [Calling Integration](/ui-kit/react/calling-integration#step-7-render-cometchatincomingcall). The call's settings were fixed when it started ringing, so settings passed to that `CometChatOngoingCall` don't apply. For a call from an app on legacy ringing, it replaces `CometChat.acceptCall`, as before. + +To run your own code when the user answers, and keep the kit's answer, listen for `ui:call/accepted` instead. | | | | --- | --- | @@ -288,7 +288,9 @@ Custom accept handler. When provided, overrides the default `CometChat.acceptCal ### onDecline -Custom decline handler. When provided, overrides the default `CometChat.rejectCall` behavior. +Custom decline handler. When provided, the kit doesn't decline the call: it only stops ringing and leaves the session it prepared, which ends a 1:1 call for the caller as unanswered. For a call from an app on legacy ringing, it replaces `CometChat.rejectCall`, as before. + +To run your own code when the user declines, and keep the kit's decline, listen for `ui:call/rejected` instead. | | | | --- | --- | @@ -332,7 +334,9 @@ Custom sound URL to play for incoming calls (replaces the built-in ringtone). ### callSettingsBuilder -Meant to customize the session that starts when the call is accepted: a function that receives the call and returns session settings (`SessionSettings`, the same object [`CometChatCallButtons`](/ui-kit/react/components/call-buttons#call-settings) takes). +Customizes the session of a call this component answers: a function that receives the call and returns session settings (`SessionSettings`, the same object [`CometChatCallButtons`](/ui-kit/react/components/call-buttons#call-settings) takes). Falls back to `GlobalConfig.callSettingsBuilder`. + +For a 1:1 call on the ringing flow, the session is set up when the call starts ringing, and the kit lays these settings over its own defaults then. `sessionType` comes from the call's type, and `isPeerCall` is always on. | | | | --- | --- | @@ -340,7 +344,7 @@ Meant to customize the session that starts when the call is accepted: a function | Default | `undefined` | -In 7.2.4 the value this function returns is not applied: `CometChatIncomingCall` hands it to the ongoing call under a prop name the ongoing call does not read, so an accepted call uses the global or default settings. Set session settings for every call on `CometChatProvider` instead, which the ongoing call does read: +For a call from an app on legacy ringing, the value this function returns is not applied: `CometChatIncomingCall` hands it to the ongoing call under a prop name the ongoing call does not read, so such a call uses the global or default settings. To cover those calls too, set session settings on `CometChatProvider`, which the ongoing call does read: ```tsx import { CometChatProvider, type SessionSettings } from "@cometchat/chat-uikit-react"; From 72632c1ab92cc65d7a6c07c7b24e889f1ad0a7bd Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:55:05 +0530 Subject: [PATCH 06/23] docs(angular): add the call host, and say how calls ring Calling in the Angular UI Kit v5 moves to the Calls SDK 5.1 ringing flow. The Call Features page now: - installs the Calls SDK 5.1.1 or later, which 1:1 calls need (5.0.x fails with CALLS_SDK_UNAVAILABLE); - has a step that puts the incoming call card and the call host once at the root; - has a "How calls ring" section: the caller's screen, the 45 s ring, busy, group calls, and what the Connect legacy ringing setting changes. The new Call Host page documents , now a public component. It is ported from the draft in the UI Kit repo's own docs/ folder. The nav, the components overview and the LLM index list it. Co-Authored-By: Claude Opus 5.5 --- docs.json | 1 + ui-kit/angular/call-features.mdx | 37 +++++++++- .../components/cometchat-call-host.mdx | 71 +++++++++++++++++++ .../components/components-overview.mdx | 1 + ui-kit/angular/llms-angular-v5.mdx | 1 + 5 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 ui-kit/angular/components/cometchat-call-host.mdx diff --git a/docs.json b/docs.json index 58788a8cd..07f61a62f 100644 --- a/docs.json +++ b/docs.json @@ -2680,6 +2680,7 @@ "group": "Calls", "pages": [ "ui-kit/angular/components/cometchat-call-buttons", + "ui-kit/angular/components/cometchat-call-host", "ui-kit/angular/components/cometchat-incoming-call", "ui-kit/angular/components/cometchat-outgoing-call", "ui-kit/angular/components/cometchat-call-logs" diff --git a/ui-kit/angular/call-features.mdx b/ui-kit/angular/call-features.mdx index 3e8ff40a6..b502d124b 100644 --- a/ui-kit/angular/call-features.mdx +++ b/ui-kit/angular/call-features.mdx @@ -15,10 +15,15 @@ Ensure `CometChatUIKit.init()` has completed and the user is logged in before us Install the Calls SDK: +{/* TODO(release): the first Calls SDK release with the fix the UI Kit needs. */} ```bash -npm install @cometchat/calls-sdk-javascript +npm install @cometchat/calls-sdk-javascript@^5.1.1 ``` + +1:1 calls need the Calls SDK 5.1.1 or later. On 5.0.x, every 1:1 call fails with the error `CALLS_SDK_UNAVAILABLE`. + + Then enable calling in your `UIKitSettingsBuilder`: ```typescript @@ -36,6 +41,18 @@ const settings = new UIKitSettingsBuilder() When enabled, [cometchat-call-buttons](/ui-kit/angular/components/cometchat-call-buttons) renders in [cometchat-message-header](/ui-kit/angular/components/cometchat-message-header) and the trailing call button appears in [cometchat-call-logs](/ui-kit/angular/components/cometchat-call-logs). +### Add the incoming call card and the call host + +Put [cometchat-incoming-call](/ui-kit/angular/components/cometchat-incoming-call) and [cometchat-call-host](/ui-kit/angular/components/cometchat-call-host) once in your root component, next to the router outlet: + +```html + + + +``` + +The incoming call card rings for calls to the logged-in user. The call host draws the screens of every call, so a call carries on when the user opens another chat. Without it, the call buttons draw the screens themselves, and a call ends when the call buttons that placed it are destroyed. + ### Custom Call App Settings By default the UIKit builds `CallAppSettings` from your `appId` and `region`. If you need custom configuration (e.g. a different region for the Calls SDK or additional settings), pass your own `CallAppSettings`: @@ -65,6 +82,24 @@ const settings = new UIKitSettingsBuilder() +## How calls ring + +1:1 calls ring through the Calls SDK, on its [ringing flow](/calls/javascript/ringing). The kit places, answers, declines and cancels them, so the app writes no ringing code: + +- The caller's screen reads "Calling...", then "Ringing..." once the callee's device rings. +- The callee sees the [cometchat-incoming-call](/ui-kit/angular/components/cometchat-incoming-call) card. When one of the callee's tabs or devices answers or declines, the others stop ringing. +- If nobody answers within 45 seconds, the caller's kit ends the call as unanswered. +- A tab that is already in a call, placing one or showing an incoming call answers a new 1:1 call busy, without showing it. + +Group calls that the kit places don't ring. The kit sends a meeting message to the group, and members join the call from it. + +### The Connect legacy ringing setting + +**Connect legacy ringing**, in the dashboard under **Voice & Video Calls → Settings**, also sends calls on this flow as legacy call events. Turn it on while some of your users are on apps on legacy ringing, such as an older UI Kit or a mobile app that doesn't ring with the Calls SDK 5.1 and the Push Notifications SDK 2.0; see [While some users are still on legacy ringing](/calls/javascript/migrating-from-legacy-ringing#while-some-users-are-still-on-legacy-ringing). While it's off: + +- An app on legacy ringing that is called keeps ringing after the caller cancels. +- A decline, a cancel or no answer shows on the other side a few seconds late. The kit learns of it by reading the call's status every 3 seconds while the call rings, and from the call's messages once it ends. + ## Features ### Incoming Call diff --git a/ui-kit/angular/components/cometchat-call-host.mdx b/ui-kit/angular/components/cometchat-call-host.mdx new file mode 100644 index 000000000..54547ec51 --- /dev/null +++ b/ui-kit/angular/components/cometchat-call-host.mdx @@ -0,0 +1,71 @@ +--- +title: "Call Host" +description: "A standalone Angular component, placed once at the root of the app, that draws the screens of a call so they stay up when the call buttons that placed it are destroyed" +--- + + + +| Field | Value | +| --- | --- | +| Component | `CometChatCallHostComponent` | +| Package | `@cometchat/chat-uikit-angular` v5.x | +| Import | `import { CometChatCallHostComponent } from "@cometchat/chat-uikit-angular";` | +| Selector | `` — the class name is NOT a valid tag | +| Standalone | Add `CometChatCallHostComponent` to the consuming component's `imports: []` or it renders **nothing**, silently | +| Inputs and outputs | None. The screens take their settings from the call buttons that placed the call | +| Prerequisites | `CometChatUIKit.initFromSettings()` resolved **and** `login()` complete, and calling enabled — see [Call Features](/ui-kit/angular/call-features) | +| Stitching | Mount **once** at the app root, next to `` and `` | +| Automatic behaviour | Draws the outgoing call screen while a 1:1 call rings, and the ongoing call screen once a call is answered or a group call starts | +| Related | [Components overview](/ui-kit/angular/components/components-overview) · [LLM index](/ui-kit/angular/llms-angular-v5) | + + + +## Overview + +The CometChatCallHost component draws the screens of a call: the outgoing call screen while a 1:1 call rings, and the ongoing call screen once it is answered or a group call starts. It draws them for calls placed from [cometchat-call-buttons](/ui-kit/angular/components/cometchat-call-buttons) (including the buttons in [cometchat-message-header](/ui-kit/angular/components/cometchat-message-header)) and [cometchat-call-logs](/ui-kit/angular/components/cometchat-call-logs), and for calls answered from [cometchat-incoming-call](/ui-kit/angular/components/cometchat-incoming-call). + +Put one `` at the root of your app. While it is mounted, the call buttons leave the screens to it, so a call carries on when the user opens another chat or leaves the page the call was placed from. + +Without a call host, each call buttons component draws the screens itself, inside the component. When the last call buttons component that draws them is destroyed, the call ends with them: a call that is still ringing is cancelled, and an answered call is left. That way the other person is never left ringing, or talking to nobody, while this user sees no call. + +### Key Features + +- **Screens that outlive the buttons**: A call goes on when the call buttons that placed it are destroyed +- **One place for every call**: Draws the screens of calls from the call buttons, the message header, the call logs and the incoming call card +- **Ringing status**: The outgoing call screen says "Ringing..." once the callee's device rings +- **Settings from the call buttons**: Uses the `callSettingsBuilder`, sound settings and `onError` of the call buttons that placed the call, then the [GlobalConfig](/ui-kit/angular/customization/global-config) + +## Basic Usage + +Add it next to your router outlet, in the root component: + +```typescript expandable +import { Component } from '@angular/core'; +import { RouterOutlet } from '@angular/router'; +import { + CometChatCallHostComponent, + CometChatIncomingCallComponent, +} from '@cometchat/chat-uikit-angular'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [RouterOutlet, CometChatCallHostComponent, CometChatIncomingCallComponent], + template: ` + + + + `, +}) +export class AppComponent {} +``` + + +Mount only one call host. It has no inputs or outputs: the screens it draws take their settings from the call buttons that placed the call. + + +## Related Components + +- [CometChatCallButtons](/ui-kit/angular/components/cometchat-call-buttons) — Places the calls whose screens the host draws +- [CometChatIncomingCall](/ui-kit/angular/components/cometchat-incoming-call) — Answers incoming calls; the host draws the answered call's screen +- [CometChatOutgoingCall](/ui-kit/angular/components/cometchat-outgoing-call) — The outgoing call screen the host draws while a call rings diff --git a/ui-kit/angular/components/components-overview.mdx b/ui-kit/angular/components/components-overview.mdx index 2d72bc7db..7cc203415 100644 --- a/ui-kit/angular/components/components-overview.mdx +++ b/ui-kit/angular/components/components-overview.mdx @@ -169,6 +169,7 @@ All components are imported from `@cometchat/chat-uikit-angular`. | Component | Purpose | Key Inputs | Page | | --- | --- | --- | --- | | cometchat-call-buttons | Voice and video call initiation buttons | `user`, `group` | [Call Buttons](/ui-kit/angular/components/cometchat-call-buttons) | +| cometchat-call-host | Draws the screens of every call, once at the app root | *(none)* | [Call Host](/ui-kit/angular/components/cometchat-call-host) | | cometchat-incoming-call | Incoming call notification with accept/decline | `call` | [Incoming Call](/ui-kit/angular/components/cometchat-incoming-call) | | cometchat-outgoing-call | Outgoing call screen with cancel control | `call` | [Outgoing Call](/ui-kit/angular/components/cometchat-outgoing-call) | | cometchat-call-logs | Scrollable list of call history | `callLogsRequestBuilder` | [Call Logs](/ui-kit/angular/components/cometchat-call-logs) | diff --git a/ui-kit/angular/llms-angular-v5.mdx b/ui-kit/angular/llms-angular-v5.mdx index 4be4c090f..288d5cb50 100644 --- a/ui-kit/angular/llms-angular-v5.mdx +++ b/ui-kit/angular/llms-angular-v5.mdx @@ -113,6 +113,7 @@ exhaustive inputs, long-tail components, theming tokens, or feature enablement. ## Components — calling - [Call Features](/ui-kit/angular/call-features) - [Call Buttons](/ui-kit/angular/components/cometchat-call-buttons) +- [Call Host](/ui-kit/angular/components/cometchat-call-host) - [Call Logs](/ui-kit/angular/components/cometchat-call-logs) - [Incoming Call](/ui-kit/angular/components/cometchat-incoming-call) - [Outgoing Call](/ui-kit/angular/components/cometchat-outgoing-call) From 975405f8e64f513bcfdc66f0fd9ff93bea0cd24d Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:55:25 +0530 Subject: [PATCH 07/23] docs(react): show "Ringing..." and place calls the kit's way on Outgoing Call The page said the screen reads "Calling...". It reads "Outgoing Call", then "Ringing..." once the receiver's device rings, for any call the kit placed. The examples placed and cancelled calls with CometChat.initiateCall and rejectCall, which never ring on the Calls SDK flow and never show "Ringing...". The standalone example now uses useCometChatCallButtons to place and cancel the call and to show the ongoing call, and the flat example leaves the cancel to the caller. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/components/outgoing-call.mdx | 86 ++++++++++------------- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/ui-kit/react/components/outgoing-call.mdx b/ui-kit/react/components/outgoing-call.mdx index 7aa24d994..683fde3f4 100644 --- a/ui-kit/react/components/outgoing-call.mdx +++ b/ui-kit/react/components/outgoing-call.mdx @@ -20,7 +20,7 @@ description: "Displays the outgoing call screen with receiver info and a cancel ## Overview -`CometChatOutgoingCall` is a purely presentational component that displays the outgoing call screen while waiting for the receiver to answer. It shows the receiver's name, avatar, a "Calling..." subtitle, and an end-call button. +`CometChatOutgoingCall` is a purely presentational component that displays the outgoing call screen while waiting for the receiver to answer. It shows the receiver's name, avatar, an "Outgoing Call" subtitle that changes to "Ringing..." once the receiver's device rings, and an end-call button. **Live Preview** — interact with the default outgoing call screen. @@ -38,13 +38,13 @@ description: "Displays the outgoing call screen with receiver info and a cancel The component handles: - Displaying receiver name and avatar from the `call` object -- "Calling..." subtitle text +- "Outgoing Call" subtitle text, then "Ringing..." once the receiver's device rings, for any call the kit placed (see [How calls ring](/ui-kit/react/call-features#how-calls-ring)) - End-call/cancel button - Outgoing call sound playback (looping while mounted, pauses on unmount) > **Required prop:** The `call` prop is required. The component needs a valid `CometChat.Call` object to render receiver information. -> **Typical usage:** `CometChatOutgoingCall` is typically rendered by `CometChatMessageHeader` or `CometChatIncomingCall` internally when a call is initiated, but it can be used standalone. +> **Typical usage:** `CometChatOutgoingCall` is typically rendered by `CometChatCallButtons` (inside `CometChatMessageHeader`) when a call is placed, but it can be used standalone. --- @@ -53,66 +53,58 @@ The component handles: ### Flat API ```tsx -import { CometChat } from "@cometchat/chat-sdk-javascript"; +import type { CometChat } from "@cometchat/chat-sdk-javascript"; import { CometChatOutgoingCall } from "@cometchat/chat-uikit-react"; -function OutgoingCallScreen({ call }: { call: CometChat.Call }) { - return ( - { - console.log("Call canceled by user"); - // Cancel the call via SDK - CometChat.rejectCall(call.getSessionId(), CometChat.CALL_STATUS.CANCELLED); - }} - /> - ); +function OutgoingCallScreen({ call, onCancel }: { call: CometChat.Call; onCancel: () => void }) { + return ; } ``` +`CometChatOutgoingCall` only draws the screen: `onCallCanceled` must cancel the call itself. + ### Standalone Usage Example +To place and cancel a call the way the kit does, so that it rings through the Calls SDK, use the `useCometChatCallButtons` hook. It places the call, gives you `activeCall` for this screen and `cancelOutgoingCall` for its button, and tells you when to show the ongoing call: + ```tsx -import { useState } from "react"; import { CometChat } from "@cometchat/chat-sdk-javascript"; -import { CometChatOutgoingCall } from "@cometchat/chat-uikit-react"; - -function CallManager() { - const [outgoingCall, setOutgoingCall] = useState(null); - - const initiateCall = async (receiverUID: string) => { - const call = new CometChat.Call( - receiverUID, - CometChat.CALL_TYPE.VIDEO, - CometChat.RECEIVER_TYPE.USER - ); - const initiatedCall = await CometChat.initiateCall(call); - setOutgoingCall(initiatedCall); - }; - - const cancelCall = () => { - if (outgoingCall) { - CometChat.rejectCall( - outgoingCall.getSessionId(), - CometChat.CALL_STATUS.CANCELLED - ); - setOutgoingCall(null); - } - }; +import { + CometChatOngoingCall, + CometChatOutgoingCall, + useCometChatCallButtons, +} from "@cometchat/chat-uikit-react"; + +function CallManager({ user }: { user: CometChat.User }) { + const { + activeCall, + callButtonsDisabled, + showOutgoingCallScreen, + showOngoingCall, + callSessionId, + initiateVideoCall, + cancelOutgoingCall, + resetCallState, + } = useCometChatCallButtons({ user }); return (
- {outgoingCall && ( - + + {showOutgoingCallScreen && activeCall && ( + + )} + {showOngoingCall && callSessionId && ( + )}
); } ``` +A call placed with `CometChat.initiateCall` and cancelled with `CometChat.rejectCall` goes the legacy way instead: it isn't on the ringing flow, and its screen never shows "Ringing...". See [Custom Call Screens](/ui-kit/react/custom-call-screens) for the hook's full API. + --- ## Actions and Events @@ -157,7 +149,7 @@ Use view props to replace sections of the default UI while keeping the component | Slot | Type | Replaces | | --- | --- | --- | | `titleView` | `ReactNode` | Receiver name | -| `subtitleView` | `ReactNode` | "Calling..." text | +| `subtitleView` | `ReactNode` | "Outgoing Call" / "Ringing..." text | | `avatarView` | `ReactNode` | Receiver avatar | | `cancelButtonView` | `ReactNode` | End-call button | @@ -380,7 +372,7 @@ Custom view that replaces the receiver name. ### subtitleView -Custom view that replaces the "Calling..." text. +Custom view that replaces the "Outgoing Call" / "Ringing..." text. | | | | --- | --- | From 4452edd81f5aea9facac125a89607bda5033c79a Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:56:06 +0530 Subject: [PATCH 08/23] docs(react): say how callSettingsBuilder applies to 1:1 calls elsewhere Message Header, Call Logs and the property-changes table said the settings go unchanged to CometChatOngoingCall. For a 1:1 call they are now laid over the kit's defaults when the call is placed, with sessionType from the button; a group call's still replace the defaults. Call Logs also says its calls ring as the call buttons' do, and types the prop as SessionSettings. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/components/call-logs.mdx | 6 +++--- ui-kit/react/components/message-header.mdx | 2 +- ui-kit/react/migration-property-changes.mdx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui-kit/react/components/call-logs.mdx b/ui-kit/react/components/call-logs.mdx index a06ef9c68..f5ea58b37 100644 --- a/ui-kit/react/components/call-logs.mdx +++ b/ui-kit/react/components/call-logs.mdx @@ -43,7 +43,7 @@ The component handles: - Paginated fetching of call logs with infinite scroll - Call direction indicators (incoming, outgoing, missed) - Call duration and timestamp display -- Call button in trailing view to re-initiate calls +- Call button in trailing view to re-initiate calls, which ring through the Calls SDK as calls from the [call buttons](/ui-kit/react/components/call-buttons) do - Transition to outgoing/ongoing call screens internally when a call is initiated - Active call highlighting @@ -279,11 +279,11 @@ Callback when an SDK error occurs during fetch operations. ### callSettingsBuilder -Custom call settings builder for ongoing call sessions initiated from call logs. Falls back to `GlobalConfig.callSettingsBuilder`, then default settings. +Session settings (`SessionSettings`) for calls placed from the call logs. The call logs place calls with `CometChatCallButtons`, so they ring the same way, and their settings are laid over the kit's defaults when the call is placed, with `sessionType` from the call's type. Falls back to `GlobalConfig.callSettingsBuilder`, then default settings. See [Call Settings](/ui-kit/react/components/call-buttons#call-settings). | | | | --- | --- | -| Type | `any` | +| Type | `SessionSettings` (typed `any`) | | Default | `undefined` | --- diff --git a/ui-kit/react/components/message-header.mdx b/ui-kit/react/components/message-header.mdx index 97b85d112..5dc2fabde 100644 --- a/ui-kit/react/components/message-header.mdx +++ b/ui-kit/react/components/message-header.mdx @@ -703,7 +703,7 @@ Remove the "Pinned messages" entry from the overflow menu. The entry only appear ### callSettingsBuilder -Session settings for calls started from the header's call buttons. In v7 this prop takes a session-settings **object** (`SessionSettings`), not a builder function: the header passes it unchanged to `CometChatCallButtons`, which hands it to `CometChatOngoingCall` as `callSettings`. Falls back to `GlobalConfig.callSettingsBuilder`, then the built-in default. See [Call Buttons](/ui-kit/react/components/call-buttons#callsettingsbuilder). +Session settings for calls started from the header's call buttons. In v7 this prop takes a session-settings **object** (`SessionSettings`), not a builder function: the header passes it unchanged to `CometChatCallButtons`. A 1:1 call's settings are laid over the kit's defaults when the call is placed, with `sessionType` from the button pressed; a group call's are handed to `CometChatOngoingCall` as `callSettings` and replace the defaults. Falls back to `GlobalConfig.callSettingsBuilder`, then the built-in default. See [Call Settings](/ui-kit/react/components/call-buttons#call-settings). | | | | --- | --- | diff --git a/ui-kit/react/migration-property-changes.mdx b/ui-kit/react/migration-property-changes.mdx index 282a51c80..546431d92 100644 --- a/ui-kit/react/migration-property-changes.mdx +++ b/ui-kit/react/migration-property-changes.mdx @@ -294,7 +294,7 @@ A v6 formatter that relied on that inherited behaviour compiles, and then does n | `onSummaryClick` | `() => void` | 7.0.0 | Summary button click | | `onVoiceCallClick` | `(entity: User \| Group) => void` | 7.0.0 | Voice call button click | | `onVideoCallClick` | `(entity: User \| Group) => void` | 7.0.0 | Video call button click | -| `callSettingsBuilder` | `SessionSettings` (typed `any` in the 7.2.4 declarations) | 7.0.0 | Session settings **object** (not a builder function) for calls started from the header, passed unchanged to `CometChatCallButtons` and on to `CometChatOngoingCall` as `callSettings` — see [Message Header](/ui-kit/react/components/message-header#callsettingsbuilder) | +| `callSettingsBuilder` | `SessionSettings` (typed `any` in the 7.2.4 declarations) | 7.0.0 | Session settings **object** (not a builder function) for calls started from the header, passed unchanged to `CometChatCallButtons`. A 1:1 call's settings are laid over the kit's defaults when the call is placed; a group call's go to `CometChatOngoingCall` as `callSettings` — see [Message Header](/ui-kit/react/components/message-header#callsettingsbuilder) | --- From fa6488852616c7ea9957b492da10a17fff20c4bf Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:56:52 +0530 Subject: [PATCH 09/23] docs(angular): call settings are a plain SessionSettings object, laid over the defaults for 1:1 calls The call buttons, message header, call logs and global config pages showed `new CometChatCalls.CallSettingsBuilder()...build()`, but the v5 kit reads a plain Calls SDK v5 SessionSettings object. The examples now pass one, and the pages say how it applies: - a 1:1 call lays it over the kit's defaults, takes sessionType from the call, always turns isPeerCall on, and fixes the settings when the call is placed or starts ringing; - a group call uses it in place of the defaults, as before. The call buttons and call logs pages say what the call host changes: with one at the root it draws the call's screens; without one, destroying the component that draws them ends the call. The incoming call card now uses GlobalConfig.callSettingsBuilder for the 1:1 calls it answers, which the global config tables list. Co-Authored-By: Claude Opus 5.5 --- .../components/cometchat-call-buttons.mdx | 35 ++++++++++--------- .../components/cometchat-call-logs.mdx | 25 ++++++------- .../components/cometchat-message-header.mdx | 22 ++++++------ .../angular/customization/global-config.mdx | 35 ++++++++++++------- 4 files changed, 65 insertions(+), 52 deletions(-) diff --git a/ui-kit/angular/components/cometchat-call-buttons.mdx b/ui-kit/angular/components/cometchat-call-buttons.mdx index 9a25620a5..e48e938ad 100644 --- a/ui-kit/angular/components/cometchat-call-buttons.mdx +++ b/ui-kit/angular/components/cometchat-call-buttons.mdx @@ -16,7 +16,7 @@ description: "A standalone Angular component that provides voice and video call | Primary output | `(error)` — call initiation failures | | Prerequisites | `CometChatUIKit.initFromSettings()` resolved **and** `login()` complete before render — see [Integration](/ui-kit/angular/integration) | | Stitching | Bind `[user]`/`[group]`. The message header already renders call buttons, so check before adding a second set. | -| Automatic behaviour | Call initiation and permission prompts are internal | +| Automatic behaviour | Call initiation and permission prompts are internal. 1:1 calls ring through the Calls SDK; group calls send a meeting message. See [How calls ring](/ui-kit/angular/call-features#how-calls-ring) | | Sizing | Fills its container — an ancestor without a resolved height collapses it to 0px | | Full props | See [Properties](#properties) | | Events | See [Events](#events) | @@ -27,7 +27,7 @@ description: "A standalone Angular component that provides voice and video call ## Overview -The CometChatCallButtons component renders voice and video call buttons for initiating calls to a user or group. It delegates call state management and initiation logic to an internal service, and displays the outgoing call overlay and ongoing call screen automatically when a call is in progress. +The CometChatCallButtons component renders voice and video call buttons for initiating calls to a user or group. It delegates call state management and initiation logic to an internal service, and displays the outgoing call overlay and ongoing call screen automatically when a call is in progress. With a [cometchat-call-host](/ui-kit/angular/components/cometchat-call-host) at the root of the app, the host draws those screens instead, so they stay up when this component is destroyed. Without one, destroying the last call buttons that draw the screens ends the call: a ringing call is cancelled, and an answered call is left. ### Key Features @@ -95,7 +95,7 @@ export class CallButtonsDemoComponent { | `onError` | `((error: CometChat.CometChatException) => void) \| null` | `null` | Error callback invoked for any error during call operations. | | `outgoingCallDisableSoundForCalls` | `boolean` | `false` | Disables sound for the outgoing call overlay. Supports global config override. | | `outgoingCallCustomSoundForCalls` | `string` | `''` | Custom sound URL for the outgoing call overlay. Supports global config override. | -| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object used to override the default call settings in the ongoing call screen. Pass a built `SessionSettings` object — the kit does **not** call `.build()` internally. Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | +| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object for the call screen. For a 1:1 call it is laid over the kit's defaults when the call is placed; for a group call it replaces them. See [Custom Call Settings](#custom-call-settings). Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | | `voiceCallButtonView` | `TemplateRef \| null` | `null` | Replaces the default voice call button with a custom template. | | `videoCallButtonView` | `TemplateRef \| null` | `null` | Replaces the default video call button with a custom template. | @@ -137,12 +137,12 @@ cometchat-call-buttons { ### Custom Call Settings -Pass a plain v5 `SessionSettings` object to customize the call UI. Build the object yourself with `.build()` — the kit does **not** call `.build()` internally: +Pass a plain v5 `SessionSettings` object to customize the call screen. It isn't a builder: the kit reads the object as it is. ```typescript expandable -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { CometChat } from '@cometchat/chat-sdk-javascript'; -import { CometChatCalls } from '@cometchat/calls-sdk-javascript'; +import type { SessionSettings } from '@cometchat/calls-sdk-javascript'; import { CometChatCallButtonsComponent } from '@cometchat/chat-uikit-angular'; @Component({ @@ -156,20 +156,22 @@ import { CometChatCallButtonsComponent } from '@cometchat/chat-uikit-angular'; ` }) -export class CustomCallSettingsComponent implements OnInit { +export class CustomCallSettingsComponent { activeUser!: CometChat.User; - customCallSettings: any; - - ngOnInit(): void { - // Build the SessionSettings object yourself — the kit does not call .build(). - this.customCallSettings = new CometChatCalls.CallSettingsBuilder() - .enableDefaultLayout(true) - .setIsAudioOnlyCall(false) - .build(); - } + + customCallSettings: SessionSettings = { + layout: 'SIDEBAR', + startAudioMuted: true, + hideRecordingButton: false, + }; } ``` +How the object applies depends on the call: + +- **1:1 calls:** the object is laid over the kit's defaults, so you set only what you change. `sessionType` comes from the button pressed (voice or video), and `isPeerCall` is always on, so hanging up ends the call for both people. The settings are fixed when the call is placed, so a change made while it rings or runs doesn't reach that call. +- **Group calls:** the object replaces the kit's defaults, so include every setting you need, such as `sessionType`. + You can also set `callSettingsBuilder` globally via [GlobalConfig](/ui-kit/angular/customization/global-config) so all call components use the same settings without passing the input to each one. @@ -191,6 +193,7 @@ export class CustomCallSettingsComponent implements OnInit { ## Related Components +- [CometChatCallHost](/ui-kit/angular/components/cometchat-call-host) — Draws the call screens instead of this component, so they outlive it - [CometChatOutgoingCall](/ui-kit/angular/components/cometchat-outgoing-call) — Displayed automatically when a call is initiated - [CometChatOngoingCall](/ui-kit/angular/components/cometchat-outgoing-call) — Displayed automatically when a call is accepted - [CometChatMessageHeader](/ui-kit/angular/components/cometchat-message-header) — Typically hosts the call buttons diff --git a/ui-kit/angular/components/cometchat-call-logs.mdx b/ui-kit/angular/components/cometchat-call-logs.mdx index 0d06062cc..a5a9ffa7d 100644 --- a/ui-kit/angular/components/cometchat-call-logs.mdx +++ b/ui-kit/angular/components/cometchat-call-logs.mdx @@ -28,6 +28,8 @@ description: "A comprehensive Angular component for displaying call history with The CometChatCallLogs component displays a paginated, scrollable list of call history records for the logged-in user. Each call log entry shows the other party's avatar and name, the call direction (incoming, outgoing, or missed), the call type (audio or video), and the timestamp. Users can initiate new calls directly from the list and view real-time call overlays for outgoing and ongoing calls. +A call placed from the call logs rings through the Calls SDK, as one placed from the call buttons does; see [How calls ring](/ui-kit/angular/call-features#how-calls-ring). With a [cometchat-call-host](/ui-kit/angular/components/cometchat-call-host) at the root of the app, the host draws the call's screens. Without one, the call logs draw them, and destroying the call logs ends the call: a ringing call is cancelled, and an answered call is left. + The component follows a **Service-based Architecture** where: - **CallLogsService** handles call log fetching, pagination, call initiation, call lifecycle listeners, and state management via Angular signals - **Component** manages UI rendering, template overrides, and user interactions @@ -153,7 +155,7 @@ When `callButtonClicked` has no observers, clicking the trailing call button aut | `callLogRequestBuilder` | `any` | `null` | Custom `CallLogRequestBuilder` from `CometChatCalls`. When provided, overrides the default builder (limit 30, category "call"). | | `callInitiatedDateTimeFormat` | `CalendarObject \| null` | `null` | Custom date format for the call initiation timestamp. Merged with global and default `CalendarObject` formats (component-level wins). | | `showScrollbar` | `boolean` | `false` | Whether to show the scrollbar on the call logs list. | -| `callSettingsBuilder` | `CallSettingsBuilder` | `undefined` | Custom `CallSettingsBuilder` to override the default call settings used in the ongoing call overlay. Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | +| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object for the calls placed from the call logs. It is laid over the kit's defaults when the call is placed. See [Custom Call Settings](#custom-call-settings). Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | | `onError` | `((error: CometChat.CometChatException) => void) \| null` | `null` | Error callback invoked when any error occurs during operations such as fetching call logs or initiating calls. | ### Template Properties @@ -320,11 +322,11 @@ export class ActiveCallLogsComponent { ### Custom Call Settings -Override the default `CallSettingsBuilder` used in the ongoing call overlay when a call is initiated from the call logs: +Pass a plain v5 `SessionSettings` object for calls placed from the call logs. It isn't a builder: the kit reads the object as it is. ```typescript expandable -import { Component, OnInit } from '@angular/core'; -import { CometChatCalls } from '@cometchat/calls-sdk-javascript'; +import { Component } from '@angular/core'; +import type { SessionSettings } from '@cometchat/calls-sdk-javascript'; import { CometChatCallLogsComponent } from '@cometchat/chat-uikit-angular'; @Component({ @@ -338,14 +340,11 @@ import { CometChatCallLogsComponent } from '@cometchat/chat-uikit-angular'; ` }) -export class CustomCallSettingsLogsComponent implements OnInit { - customCallSettings: any; - - ngOnInit(): void { - this.customCallSettings = new CometChatCalls.CallSettingsBuilder() - .enableDefaultLayout(true) - .setIsAudioOnlyCall(false); - } +export class CustomCallSettingsLogsComponent { + customCallSettings: SessionSettings = { + layout: 'SIDEBAR', + startAudioMuted: true, + }; onCallLogClick(callLog: any): void { console.log('Call log clicked:', callLog); @@ -353,6 +352,8 @@ export class CustomCallSettingsLogsComponent implements OnInit { } ``` +Calls from the call logs are 1:1 calls, so the object is laid over the kit's defaults, and you set only what you change. `sessionType` comes from the call log's type, and the settings are fixed when the call is placed. + You can also set `callSettingsBuilder` globally via [GlobalConfig](/ui-kit/angular/customization/global-config) so all call components use the same settings without passing the input to each one. diff --git a/ui-kit/angular/components/cometchat-message-header.mdx b/ui-kit/angular/components/cometchat-message-header.mdx index 4b4936c4b..1ad609e5f 100644 --- a/ui-kit/angular/components/cometchat-message-header.mdx +++ b/ui-kit/angular/components/cometchat-message-header.mdx @@ -160,7 +160,7 @@ export class GroupChatComponent { | `showSearchOption` | `boolean` | `false` | Show the search option in the header | | `showConversationSummaryButton` | `boolean` | `false` | Show the AI conversation summary button | | `showPinnedMessagesOption` | `boolean` | `false` | Add a "Pinned messages" entry to the overflow menu. The header only asks for the panel — the host opens it. See [Pinned Messages](#pinned-messages) | -| `callSettingsBuilder` | `CallSettingsBuilder` | `undefined` | Custom `CallSettingsBuilder` forwarded to the call buttons and ongoing call screen. Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | +| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object, forwarded to the call buttons. For a 1:1 call it is laid over the kit's defaults when the call is placed; for a group call it replaces them. See [Custom Call Settings](#custom-call-settings). Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | ### AI Configuration Properties @@ -397,12 +397,12 @@ When both search and summary options are enabled, they appear in an overflow men ### Custom Call Settings -Override the default `CallSettingsBuilder` used when calls are initiated from the message header: +Pass a plain v5 `SessionSettings` object for calls placed from the message header. It isn't a builder: the kit reads the object as it is. ```typescript expandable -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { CometChat } from '@cometchat/chat-sdk-javascript'; -import { CometChatCalls } from '@cometchat/calls-sdk-javascript'; +import type { SessionSettings } from '@cometchat/calls-sdk-javascript'; import { CometChatMessageHeaderComponent } from '@cometchat/chat-uikit-angular'; @Component({ @@ -416,18 +416,18 @@ import { CometChatMessageHeaderComponent } from '@cometchat/chat-uikit-angular'; ` }) -export class CustomCallHeaderComponent implements OnInit { +export class CustomCallHeaderComponent { selectedUser!: CometChat.User; - customCallSettings: any; - ngOnInit(): void { - this.customCallSettings = new CometChatCalls.CallSettingsBuilder() - .enableDefaultLayout(true) - .setIsAudioOnlyCall(false); - } + customCallSettings: SessionSettings = { + layout: 'SIDEBAR', + startAudioMuted: true, + }; } ``` +For a 1:1 call, the object is laid over the kit's defaults, and the settings are fixed when the call is placed. For a group call, it replaces the defaults. See [Custom Call Settings](/ui-kit/angular/components/cometchat-call-buttons#custom-call-settings) on the call buttons page. + You can also set `callSettingsBuilder` globally via [GlobalConfig](/ui-kit/angular/customization/global-config) so all call components use the same settings without passing the input to each one. diff --git a/ui-kit/angular/customization/global-config.mdx b/ui-kit/angular/customization/global-config.mdx index b6d983a58..bcf2b7125 100644 --- a/ui-kit/angular/customization/global-config.mdx +++ b/ui-kit/angular/customization/global-config.mdx @@ -108,7 +108,7 @@ import { COMETCHAT_GLOBAL_CONFIG } from '@cometchat/chat-uikit-angular'; | `hideAvatar` | `boolean` | `undefined` | Hide avatar across components | | `enablePinMessage` | `boolean` | `undefined` | Force the Pin Message surfaces on or off, overriding the app-level flag the Chat SDK reports | | `enableSaveMessage` | `boolean` | `undefined` | Force the Save Message surfaces on or off, overriding the app-level flag the Chat SDK reports | -| `callSettingsBuilder` | `CallSettingsBuilder` | `undefined` | Custom `CallSettingsBuilder` for call components (call buttons, call logs, ongoing call) | +| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object for the call screens (call buttons, message header, call logs, incoming calls). See [Call Settings Customization](#call-settings-customization) | All properties are optional. When a property is `undefined` (not set), the component falls back to its own internal default. @@ -140,17 +140,24 @@ See the [Pin and Save guide](/ui-kit/angular/guides/pin-and-save-messages). ## Call Settings Customization -The `callSettingsBuilder` property lets you provide a custom `CometChatCalls.CallSettingsBuilder` that is used across all call-related components. This is useful for configuring call UI features like layout, recording, analytics, or audio-only mode globally. +The `callSettingsBuilder` property takes a plain v5 `SessionSettings` object that is used across all call-related components. It isn't a builder: the kit reads the object as it is. This is useful for configuring call UI features like the layout, muted audio at the start, or the recording button globally. + +How the object applies depends on the call: + +- **1:1 calls:** the object is laid over the kit's defaults, so you set only what you change. `sessionType` comes from the call (voice or video), and `isPeerCall` is always on, so hanging up ends the call for both people. The settings are fixed when the call is placed or starts ringing, so a change made while it rings or runs doesn't reach that call. +- **Group calls:** the object replaces the kit's defaults, so include every setting you need, such as `sessionType`. ### Global Call Settings ```typescript expandable -import { CometChatCalls } from '@cometchat/calls-sdk-javascript'; +import type { SessionSettings } from '@cometchat/calls-sdk-javascript'; import { COMETCHAT_GLOBAL_CONFIG } from '@cometchat/chat-uikit-angular'; -const customCallSettings = new CometChatCalls.CallSettingsBuilder() - .enableDefaultLayout(true) - .setIsAudioOnlyCall(false); +const customCallSettings: SessionSettings = { + layout: 'SIDEBAR', + startAudioMuted: true, + hideRecordingButton: false, +}; export const appConfig: ApplicationConfig = { providers: [ @@ -186,9 +193,10 @@ Even with a global `callSettingsBuilder`, you can override it on individual comp | Component | Behavior | |-----------|----------| | [CometChatOngoingCall](/ui-kit/angular/components/cometchat-outgoing-call) | Accepts `callSettingsBuilder` as `@Input`. Passes it to `OngoingCallService`. | -| [CometChatCallButtons](/ui-kit/angular/components/cometchat-call-buttons) | Accepts `callSettingsBuilder` as `@Input`. Forwards to `CometChatOngoingCall`. | +| [CometChatCallButtons](/ui-kit/angular/components/cometchat-call-buttons) | Accepts `callSettingsBuilder` as `@Input`. Uses it for the 1:1 calls it places, and forwards it to `CometChatOngoingCall` for group calls. | | [CometChatMessageHeader](/ui-kit/angular/components/cometchat-message-header) | Accepts `callSettingsBuilder` as `@Input`. Forwards to `CometChatCallButtons`. | -| [CometChatCallLogs](/ui-kit/angular/components/cometchat-call-logs) | Accepts `callSettingsBuilder` as `@Input`. Uses it in the ongoing call overlay. | +| [CometChatCallLogs](/ui-kit/angular/components/cometchat-call-logs) | Accepts `callSettingsBuilder` as `@Input`. Uses it for the calls placed from the logs. | +| [CometChatIncomingCall](/ui-kit/angular/components/cometchat-incoming-call) | No input. Uses `GlobalConfig.callSettingsBuilder` for the 1:1 calls it answers. | ## Components That Read GlobalConfig @@ -206,18 +214,19 @@ The following components read from `COMETCHAT_GLOBAL_CONFIG` and apply the three | CometChatGroups | `hideGroupType`, `showScrollbar`, `showSearchBar`, `hideAvatar`, `disableDefaultContextMenu` | | CometChatGroupMembers | `hideUserStatus`, `showScrollbar`, `showSearchBar`, `hideAvatar`, `disableDefaultContextMenu` | | CometChatOutgoingCall | `disableSoundForCalls`, `customSoundForCalls` | -| CometChatIncomingCall | `disableSoundForCalls`, `customSoundForCalls` | +| CometChatIncomingCall | `disableSoundForCalls`, `customSoundForCalls`, `callSettingsBuilder` | ## Full Example ```typescript expandable import { ApplicationConfig } from '@angular/core'; -import { CometChatCalls } from '@cometchat/calls-sdk-javascript'; +import type { SessionSettings } from '@cometchat/calls-sdk-javascript'; import { COMETCHAT_GLOBAL_CONFIG, GlobalConfig } from '@cometchat/chat-uikit-angular'; -const callSettings = new CometChatCalls.CallSettingsBuilder() - .enableDefaultLayout(true) - .setIsAudioOnlyCall(false); +const callSettings: SessionSettings = { + layout: 'SIDEBAR', + startAudioMuted: true, +}; export const appConfig: ApplicationConfig = { providers: [ From c5de493f89dff416996fbf889409f7569fa450c8 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:57:12 +0530 Subject: [PATCH 10/23] docs(react): say how calls show in the conversation list The Events Received table had no ui:call/* rows, though the list has always handled them. They are listed now, with the call events among the listeners, and a new "Calls in the List" section says what a call does there: only when call activities update conversations, the preview says how the call went from the user's side, the chat moves up but keeps its unread count, and after a ringing-flow call the list fetches the chat until its last message shows the outcome, placing it by time. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/components/conversations.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui-kit/react/components/conversations.mdx b/ui-kit/react/components/conversations.mdx index e997cd480..d67507240 100644 --- a/ui-kit/react/components/conversations.mdx +++ b/ui-kit/react/components/conversations.mdx @@ -348,6 +348,7 @@ UI events this component subscribes to (published by other components). These fl | `ui:group/member-kicked` | `{ group, member, message }` | Updates last message and moves to top | | `ui:group/member-banned` | `{ group, member, message }` | Updates last message and moves to top | | `ui:group/member-unbanned` | `{ group, member, message }` | Updates last message and moves to top | +| `ui:call/outgoing`, `ui:call/accepted`, `ui:call/rejected`, `ui:call/ended` | `{ call }` | Moves the conversation to the top and keeps its unread count, only when call activities update conversations — see [Calls in the List](#calls-in-the-list) | ### SDK Listeners (Automatic) @@ -358,11 +359,22 @@ These SDK listeners are attached internally. The component updates its state aut - Receipts: `onMessagesDelivered`, `onMessagesRead` - Presence: `onUserOnline`, `onUserOffline` - Groups: `onGroupMemberJoined`, `onGroupMemberLeft`, `onGroupMemberKicked`, `onGroupMemberBanned`, `onMemberAddedToGroup` +- Calls: the call events on the kit's event bus (`call/incoming`, `call/accepted`, `call/rejected`, `call/cancelled`, `call/ended`; see [Call Events](/ui-kit/react/event-system#call-events)), which follow the call activities setting too **Unread counts in large groups:** Unread message counts are calculated only for groups with up to 300 members. See [Properties and Constraints](/articles/properties-and-constraints#users-and-groups). +### Calls in the List + +Calls change the list only when the app's conversation update settings let call activities update conversations (set in the dashboard; read it with `CometChatUIKit.getConversationUpdateSettings()?.shouldUpdateOnCallActivities()`). Then: + +- The chat's preview says how the call went, from the user's side. For the caller: Outgoing Call, Call Answered, Call Ended, Call Canceled, Call Rejected, Call Unanswered or Call Busy. For the person called: Incoming Call, Call Answered, Call Ended, or Missed Call for a call they didn't take. +- A call moves the chat up but keeps its unread count. +- After a 1:1 call on the ringing flow ends, the list fetches the chat a few times, for up to about 25 seconds, until its last message shows how the call went. With **Connect legacy ringing** off, those messages reach no tab live (see [How calls ring](/ui-kit/react/call-features#how-calls-ring)). The chat is placed by that message's time, so it doesn't jump above newer chats, and pinned chats keep their place. + +When call activities don't update conversations, calls leave the list as it is. + --- ## Customization From 145e3e8d4a1b2f236c8bbcdb191871866bea99ec Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:58:03 +0530 Subject: [PATCH 11/23] docs(react): document logout's calls and the ringing flow's troubleshooting logout() now says what it does with a call in the tab before logging out: it cancels a call being placed, stops a ring (which ends a 1:1 call for the caller as unanswered), leaves a joined call, waits at most 3 s, then logs out of the Chat SDK and the Calls SDK. Troubleshooting gets a Calls section: CALLS_SDK_UNAVAILABLE on 5.0.x, late outcomes and older apps ringing on while Connect legacy ringing is off, the callee's logout ending the call, and a preview that doesn't change when call activities are off. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/components/conversations.mdx | 2 +- ui-kit/react/methods.mdx | 8 ++++++++ ui-kit/react/troubleshooting.mdx | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ui-kit/react/components/conversations.mdx b/ui-kit/react/components/conversations.mdx index d67507240..9ce3ac4a2 100644 --- a/ui-kit/react/components/conversations.mdx +++ b/ui-kit/react/components/conversations.mdx @@ -367,7 +367,7 @@ These SDK listeners are attached internally. The component updates its state aut ### Calls in the List -Calls change the list only when the app's conversation update settings let call activities update conversations (set in the dashboard; read it with `CometChatUIKit.getConversationUpdateSettings()?.shouldUpdateOnCallActivities()`). Then: +Calls change the list only when the app's conversation update settings let call activities update conversations (**Include Call Activities** in the dashboard; read it with `CometChatUIKit.getConversationUpdateSettings()?.shouldUpdateOnCallActivities()`). Then: - The chat's preview says how the call went, from the user's side. For the caller: Outgoing Call, Call Answered, Call Ended, Call Canceled, Call Rejected, Call Unanswered or Call Busy. For the person called: Incoming Call, Call Answered, Call Ended, or Missed Call for a call they didn't take. - A call moves the chat up but keeps its unread count. diff --git a/ui-kit/react/methods.mdx b/ui-kit/react/methods.mdx index 4a930787c..4dc3f70ec 100644 --- a/ui-kit/react/methods.mdx +++ b/ui-kit/react/methods.mdx @@ -131,6 +131,14 @@ Log out the current user. await CometChatUIKit.logout(); ``` +With calling enabled, a call in this tab ends first, while the Calls SDK still knows the user: + +- A call the user is placing is cancelled. +- A call ringing for the user stops ringing here. Nothing declines it, but leaving the session the kit prepared for it ends a 1:1 call for the caller and the user's other devices too, and the caller's kit records it as unanswered. +- A call the user is in is left. + +The logout waits at most 3 seconds for this, then logs out of the Chat SDK, then the Calls SDK. + **Returns:** `Promise` --- diff --git a/ui-kit/react/troubleshooting.mdx b/ui-kit/react/troubleshooting.mdx index 5530b0602..4dd9d579b 100644 --- a/ui-kit/react/troubleshooting.mdx +++ b/ui-kit/react/troubleshooting.mdx @@ -202,3 +202,17 @@ Then pass the custom theme name to the provider: ```tsx ``` + +--- + +## Calls + +1:1 calls ring through the Calls SDK 5.1 ringing flow; see [How calls ring](/ui-kit/react/call-features#how-calls-ring). + +| Symptom | Root cause | Solution | +| --- | --- | --- | +| Every 1:1 call fails with `CALLS_SDK_UNAVAILABLE` | The app has the Calls SDK 5.0.x, which has no ringing flow | Install `@cometchat/calls-sdk-javascript` 5.1.1 or later | +| A decline, cancel or no answer shows on the other side a few seconds late | With **Connect legacy ringing** off, no live event reports it. The kit reads the call's status every 3 seconds while it rings | Expected while Connect legacy ringing is off | +| A user on an older app keeps ringing after the caller cancels | The older app is on legacy ringing, and **Connect legacy ringing** is off | Turn on Connect legacy ringing in the dashboard; see [While some users are still on legacy ringing](/calls/javascript/migrating-from-legacy-ringing#while-some-users-are-still-on-legacy-ringing) | +| The callee logs out while the call rings, and the call ends for the caller as unanswered | Logout leaves the session the kit prepared for the call, and the Calls SDK ends a 1:1 call's room when anyone leaves it | Expected. Closing or reloading the callee's tab doesn't end the call: the caller keeps ringing, and the callee's other devices can still answer | +| A call doesn't change the chat's preview or move it up | The app's conversation update settings don't let call activities update conversations | Turn on **Include Call Activities** in the dashboard; see [Calls in the List](/ui-kit/react/components/conversations#calls-in-the-list) | From 1e05c7228efead1b0eae4328ae7e2b025752ef23 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:58:36 +0530 Subject: [PATCH 12/23] docs(react): say that the kit publishes a ringing call's events itself On the ringing flow the Chat SDK hears nothing after a call's initiated message while Connect legacy ringing is off, so the kit publishes call/accepted, call/rejected, call/cancelled and call/ended itself, once per call, from the call's session, the user's other tabs and the 3 s status read. The Call Events table says so, notes they can come a few seconds late, and widens call/rejected to busy and call/cancelled to no answer. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/event-system.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui-kit/react/event-system.mdx b/ui-kit/react/event-system.mdx index 398782105..22496186f 100644 --- a/ui-kit/react/event-system.mdx +++ b/ui-kit/react/event-system.mdx @@ -205,10 +205,12 @@ These events originate from the CometChat SDK (network). They fire when other us | --- | --- | --- | | `call/incoming` | `{ call: Call }` | Incoming call received | | `call/accepted` | `{ call: Call }` | Outgoing call was accepted | -| `call/rejected` | `{ call: Call }` | Outgoing call was rejected | -| `call/cancelled` | `{ call: Call }` | Incoming call was cancelled | +| `call/rejected` | `{ call: Call }` | Outgoing call was declined or answered busy | +| `call/cancelled` | `{ call: Call }` | Incoming call was cancelled or not answered | | `call/ended` | `{ call: Call }` | Call ended | +For a 1:1 call on the [ringing flow](/ui-kit/react/call-features#how-calls-ring), the Chat SDK reports only `call/incoming` while **Connect legacy ringing** is off. The kit publishes the other four itself as it learns how the call went: from the call's Calls SDK session, from the user's other tabs, or from the status read every 3 seconds while the call rings. Each is published once per call, even when the Chat SDK reports it too, and can arrive a few seconds after the event. `call.getStatus()` gives the outcome: `ongoing`, `rejected`, `busy`, `cancelled`, `unanswered` or `ended`. + ### Connection Events | Event Type | Payload | When | From 82c95ee1596b1f04c29196aa649c01f8245f4fb7 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 17:59:08 +0530 Subject: [PATCH 13/23] docs(angular): the incoming and outgoing call screens on the ringing flow Incoming call: - 1:1 calls ring through the Calls SDK, and the busy reply is the kit's. - onAccept and onDecline no longer stand for CometChat.acceptCall and rejectCall on a 1:1 call. onAccept leaves the prepared session for the app to join; onDecline still leaves it, which ends a 1:1 call for the caller as unanswered. Either way the app closes the card with IncomingCallService.setIncomingCall(null), or later calls are answered busy. - Accepting a call that stopped ringing reports CALL_NOT_RINGING to onError and the error output. - A custom Accept button answers through IncomingCallService.acceptCall. Outgoing call: the kit's own screens say "Ringing..." once the callee's device rings. The standalone example cancels with CallButtonsService.cancelOutgoingCall() instead of CometChat.rejectCall, and points a call the app placed itself to the Calls SDK's cancel. Co-Authored-By: Claude Opus 5.5 --- .../components/cometchat-incoming-call.mdx | 68 ++++++++++++++++--- .../components/cometchat-outgoing-call.mdx | 34 +++++----- 2 files changed, 78 insertions(+), 24 deletions(-) diff --git a/ui-kit/angular/components/cometchat-incoming-call.mdx b/ui-kit/angular/components/cometchat-incoming-call.mdx index e31d26864..7f0f06cc9 100644 --- a/ui-kit/angular/components/cometchat-incoming-call.mdx +++ b/ui-kit/angular/components/cometchat-incoming-call.mdx @@ -15,8 +15,8 @@ description: "A standalone Angular component that displays an incoming call noti | Standalone | Add `CometChatIncomingCallComponent` to the consuming component's `imports: []` or it renders **nothing**, silently | | Primary output | `(callAccepted)` — emits the accepted call | | Prerequisites | `CometChatUIKit.initFromSettings()` resolved **and** `login()` complete before render — see [Integration](/ui-kit/angular/integration) | -| Stitching | Mount at **app root**, not inside the chat route, or calls stop ringing on every other route. Requires `@cometchat/calls-sdk-javascript` and calling enabled in the dashboard. | -| Automatic behaviour | Ringing, decline and the ongoing-call handoff are internal | +| Stitching | Mount at **app root**, not inside the chat route, or calls stop ringing on every other route. Put [``](/ui-kit/angular/components/cometchat-call-host) next to it. Requires `@cometchat/calls-sdk-javascript` 5.1.1 or later and calling enabled in the dashboard. | +| Automatic behaviour | Ringing through the Calls SDK, decline, the busy reply and the ongoing-call handoff are internal. See [How calls ring](/ui-kit/angular/call-features#how-calls-ring) | | Sizing | Fills its container — an ancestor without a resolved height collapses it to 0px | | Full props | See [Properties](#properties) | | Events | See [Events](#events) | @@ -27,7 +27,9 @@ description: "A standalone Angular component that displays an incoming call noti ## Overview -The CometChatIncomingCall component renders an incoming call notification card when a user receives a voice or video call. It displays the caller's name, avatar, and call type icon using a `CometChatListItem`, along with Accept and Decline buttons. After accepting, it automatically renders the ongoing call screen. +The CometChatIncomingCall component renders an incoming call notification card when a user receives a voice or video call. It displays the caller's name, avatar, and call type icon using a `CometChatListItem`, along with Accept and Decline buttons. After accepting, the ongoing call screen opens: the [call host](/ui-kit/angular/components/cometchat-call-host) draws it, or the card itself when no call host is mounted. + +A 1:1 call rings through the Calls SDK. While the card rings, the kit prepares the call's session, so Accept joins at once. A tab that is already in a call, placing one or showing an incoming call answers a new 1:1 call busy, and the card never shows it. See [How calls ring](/ui-kit/angular/call-features#how-calls-ring). ### Key Features @@ -94,9 +96,9 @@ export class IncomingCallDemoComponent { | `call` | `CometChat.Call \| null` | `null` | The incoming call object. Overrides service state when provided. | | `disableSoundForCalls` | `boolean` | `false` | Disables the incoming call ringtone when `true`. Supports global config override. | | `customSoundForCalls` | `string` | `''` | Custom sound URL for the incoming call ringtone. Supports global config override. | -| `onAccept` | `((call: CometChat.Call) => void) \| null` | `null` | Custom accept handler. Overrides default SDK `CometChat.acceptCall()`. | -| `onDecline` | `((call: CometChat.Call) => void) \| null` | `null` | Custom decline handler. Overrides default SDK `CometChat.rejectCall()`. | -| `onError` | `((error: CometChat.CometChatException) => void) \| null` | `null` | Error callback invoked for any error during sound, accept, or decline. | +| `onAccept` | `((call: CometChat.Call) => void) \| null` | `null` | Custom accept handler, called instead of the kit's answer. See [Custom Accept and Decline](#custom-accept-and-decline). | +| `onDecline` | `((call: CometChat.Call) => void) \| null` | `null` | Custom decline handler, called instead of the kit's decline. See [Custom Accept and Decline](#custom-accept-and-decline). | +| `onError` | `((error: CometChat.CometChatException) => void) \| null` | `null` | Error callback invoked for any error during sound, accept, or decline. Accepting a call that is no longer ringing (the caller just cancelled) reports `CALL_NOT_RINGING`, and nothing joins. | | `itemView` | `TemplateRef<{ $implicit: IncomingCallTemplateContext }> \| null` | `null` | Replaces the entire ListItem with a custom template. | | `titleView` | `TemplateRef<{ $implicit: IncomingCallTemplateContext }> \| null` | `null` | Replaces the default caller name title in the ListItem. | | `subtitleView` | `TemplateRef<{ $implicit: IncomingCallTemplateContext }> \| null` | `null` | Replaces the default call type icon and "Incoming Call" subtitle. | @@ -111,7 +113,45 @@ export class IncomingCallDemoComponent { |-------|-------------|-------------| | `callAccepted` | `CometChat.Call` | Emitted when the user accepts the incoming call. | | `callDeclined` | `CometChat.Call` | Emitted when the user declines the incoming call. | -| `error` | `CometChat.CometChatException` | Emitted on any error during sound playback, accept, or decline. | +| `error` | `CometChat.CometChatException` | Emitted on any error during sound playback, accept, or decline, including `CALL_NOT_RINGING` when the call stopped ringing before Accept. | + +### Custom Accept and Decline + +`onAccept` and `onDecline` run instead of the kit's own answer and decline: + +- **`onAccept`, for a 1:1 call:** the kit stops ringing and keeps the session it prepared while the call rang. Your handler joins it with `CometChatCalls.getActiveSession()?.join(container)`; see [Join the session](/calls/javascript/ringing#join-the-session). The kit doesn't read the call's status before you join, so a call the caller has just cancelled can still be joined. +- **`onDecline`, for a 1:1 call:** the kit still leaves the session it prepared. Nothing declines the call, but leaving the prepared session closes a 1:1 call's room, so the call ends for the caller and the user's other devices too, recorded as unanswered. +- **For a call from an app on legacy ringing**, they replace `CometChat.acceptCall()` and `CometChat.rejectCall()`, as before. + +Either way, the card stays up until your app closes it with `IncomingCallService.setIncomingCall(null)`. Until then, later 1:1 calls are answered busy. + +```typescript expandable +import { Component, ElementRef, ViewChild, inject } from '@angular/core'; +import { CometChat } from '@cometchat/chat-sdk-javascript'; +import { CometChatCalls } from '@cometchat/calls-sdk-javascript'; +import { CometChatIncomingCallComponent, IncomingCallService } from '@cometchat/chat-uikit-angular'; + +@Component({ + selector: 'app-custom-incoming-call', + standalone: true, + imports: [CometChatIncomingCallComponent], + template: ` + +
+ ` +}) +export class CustomIncomingCallComponent { + @ViewChild('callContainer') callContainer!: ElementRef; + private incomingCallService = inject(IncomingCallService); + + accept = (call: CometChat.Call): void => { + // Close the card, or later calls are answered busy. + this.incomingCallService.setIncomingCall(null); + // Join the session the kit prepared while the call rang. + void CometChatCalls.getActiveSession()?.join(this.callContainer.nativeElement); + }; +} +``` ## Customization @@ -140,13 +180,25 @@ cometchat-incoming-call { - ``` +A custom Accept or Decline button replaces the card's own, so its handler answers the call itself. Answer through `IncomingCallService`, which answers a 1:1 call on the Calls SDK as the card's own button does: + +```typescript +private incomingCallService = inject(IncomingCallService); + +acceptCall(call: CometChat.Call): void { + this.incomingCallService.acceptCall(call.getSessionId()).catch(error => console.error(error)); +} +``` + +`IncomingCallService.declineCall(sessionId)` declines the same way. + ## Accessibility ### Keyboard Navigation diff --git a/ui-kit/angular/components/cometchat-outgoing-call.mdx b/ui-kit/angular/components/cometchat-outgoing-call.mdx index 1369204c0..0c3b33e82 100644 --- a/ui-kit/angular/components/cometchat-outgoing-call.mdx +++ b/ui-kit/angular/components/cometchat-outgoing-call.mdx @@ -27,6 +27,8 @@ description: "A standalone Angular component that displays an outgoing call over The CometChatOutgoingCall component renders a full-screen outgoing call overlay when a user initiates a voice or video call. It displays the receiver's name, a "Calling..." subtitle, the receiver's avatar, and a cancel button. The component plays an outgoing ringtone and provides focus-trapped dialog behavior. +1:1 calls ring through the Calls SDK. In the screens the kit draws (from [cometchat-call-buttons](/ui-kit/angular/components/cometchat-call-buttons), [cometchat-call-logs](/ui-kit/angular/components/cometchat-call-logs) and [cometchat-call-host](/ui-kit/angular/components/cometchat-call-host)), the subtitle changes to "Ringing..." once the callee's device rings. Used on its own, the component shows "Calling..." unless you pass `subtitleView`. See [How calls ring](/ui-kit/angular/call-features#how-calls-ring). + ### Key Features - **Receiver Information**: Displays receiver name and avatar for both user and group calls @@ -54,37 +56,37 @@ The CometChatOutgoingCall component renders a full-screen outgoing call overlay ## Basic Usage - When `` is used **standalone**, it is purely presentational. Its default cancel action only stops the local ringtone and emits `(callCanceled)` — it does **not** call the Chat SDK cancellation API. Your `(callCanceled)` handler must cancel the outgoing call itself via the Chat SDK (see the example below). + When `` is used **standalone**, it is purely presentational. Its default cancel action only stops the local ringtone and emits `(callCanceled)`; it does **not** cancel the call. Your `(callCanceled)` handler must cancel it: + + - For a call the kit placed, call `CallButtonsService.cancelOutgoingCall()`, as in the example below. + - For a call your app placed itself with the Calls SDK, end it as [Cancel a call](/calls/javascript/ringing#cancel-a-call) describes. - When the component is rendered inside ``, the buttons component performs the SDK cancellation for you, so you should **not** cancel the call again in your own handler. + When the component is rendered by ``, `` or ``, they cancel the call for you, so you should **not** cancel the call again in your own handler. ```typescript expandable -import { Component } from '@angular/core'; -import { CometChat } from '@cometchat/chat-sdk-javascript'; -import { CometChatOutgoingCallComponent } from '@cometchat/chat-uikit-angular'; +import { Component, inject } from '@angular/core'; +import { CallButtonsService, CometChatOutgoingCallComponent } from '@cometchat/chat-uikit-angular'; @Component({ selector: 'app-outgoing-call-demo', standalone: true, imports: [CometChatOutgoingCallComponent], template: ` - + @if (callButtons.showOutgoingCallScreen() && callButtons.activeCall()) { + + } ` }) export class OutgoingCallDemoComponent { - outgoingCall!: CometChat.Call; + protected callButtons = inject(CallButtonsService); // Standalone usage: the component does not cancel the call for you. - // Your handler must reject/cancel the call through the Chat SDK. async onCallCanceled(): Promise { - const sessionId = this.outgoingCall?.getSessionId(); - if (sessionId) { - await CometChat.rejectCall(sessionId, CometChat.CALL_STATUS.CANCELLED); - } + await this.callButtons.cancelOutgoingCall(); } } ``` @@ -98,7 +100,7 @@ export class OutgoingCallDemoComponent { | `customSoundForCalls` | `string` | `''` | Custom sound URL for the outgoing call ringtone. Supports global config override. | | `onError` | `((error: CometChat.CometChatException) => void) \| null` | `null` | Error callback invoked for any error during sound or cancel. | | `titleView` | `TemplateRef<{ $implicit: OutgoingCallTemplateContext }> \| null` | `null` | Replaces the default receiver name title. | -| `subtitleView` | `TemplateRef<{ $implicit: OutgoingCallTemplateContext }> \| null` | `null` | Replaces the default "Calling..." subtitle. | +| `subtitleView` | `TemplateRef<{ $implicit: OutgoingCallTemplateContext }> \| null` | `null` | Replaces the default "Calling..." subtitle. The screens the kit draws pass one that reads "Ringing..." once the callee's device rings. | | `avatarView` | `TemplateRef<{ $implicit: OutgoingCallTemplateContext }> \| null` | `null` | Replaces the default CometChatAvatar. | | `cancelButtonView` | `TemplateRef<{ $implicit: OutgoingCallTemplateContext }> \| null` | `null` | Replaces the default cancel button. | From 1828583035d3ff7a9435b637225185f7ff7e47f8 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 18:00:51 +0530 Subject: [PATCH 14/23] docs(react): add a guide to custom call screens The kit's onAccept now hands the call to the app, which joins through CometChatOngoingCall, useOngoingCall or the prepared session, and apps that draw their own call buttons need useCometChatCallButtons to place calls that ring. None of these had a page. The new guide shows how to place and cancel calls with the hook (its options, with callSettingsBuilder, and what it returns), show the outgoing and ongoing call, join into an element of the app's own with useOngoingCall, and answer calls in the app's own screen. The call buttons and outgoing call pages link to it. Co-Authored-By: Claude Opus 5.5 --- docs.json | 3 +- ui-kit/react/components/call-buttons.mdx | 2 +- ui-kit/react/components/outgoing-call.mdx | 2 +- ui-kit/react/guide-custom-call-screens.mdx | 215 +++++++++++++++++++++ 4 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 ui-kit/react/guide-custom-call-screens.mdx diff --git a/docs.json b/docs.json index 58788a8cd..a901250b8 100644 --- a/docs.json +++ b/docs.json @@ -550,7 +550,8 @@ "ui-kit/react/guide-custom-text-formatter", "ui-kit/react/guide-search-messages", "ui-kit/react/guide-new-chat-creation", - "ui-kit/react/guide-message-privately" + "ui-kit/react/guide-message-privately", + "ui-kit/react/guide-custom-call-screens" ] }, { diff --git a/ui-kit/react/components/call-buttons.mdx b/ui-kit/react/components/call-buttons.mdx index 01a0111c3..392ad14eb 100644 --- a/ui-kit/react/components/call-buttons.mdx +++ b/ui-kit/react/components/call-buttons.mdx @@ -138,7 +138,7 @@ function CallButtonsVideoOverride() { ``` -With `onVoiceCallClick` or `onVideoCallClick` set, the kit doesn't place the call, so it doesn't ring it either. To keep the kit's ringing and draw the call screens yourself, use the `useCometChatCallButtons` hook instead; see [Custom Call Screens](/ui-kit/react/custom-call-screens). +With `onVoiceCallClick` or `onVideoCallClick` set, the kit doesn't place the call, so it doesn't ring it either. To keep the kit's ringing and draw the call screens yourself, use the `useCometChatCallButtons` hook instead; see [Custom Call Screens](/ui-kit/react/guide-custom-call-screens). #### onCallEnded diff --git a/ui-kit/react/components/outgoing-call.mdx b/ui-kit/react/components/outgoing-call.mdx index 683fde3f4..96583f612 100644 --- a/ui-kit/react/components/outgoing-call.mdx +++ b/ui-kit/react/components/outgoing-call.mdx @@ -103,7 +103,7 @@ function CallManager({ user }: { user: CometChat.User }) { } ``` -A call placed with `CometChat.initiateCall` and cancelled with `CometChat.rejectCall` goes the legacy way instead: it isn't on the ringing flow, and its screen never shows "Ringing...". See [Custom Call Screens](/ui-kit/react/custom-call-screens) for the hook's full API. +A call placed with `CometChat.initiateCall` and cancelled with `CometChat.rejectCall` goes the legacy way instead: it isn't on the ringing flow, and its screen never shows "Ringing...". See [Custom Call Screens](/ui-kit/react/guide-custom-call-screens) for the hook's full API. --- diff --git a/ui-kit/react/guide-custom-call-screens.mdx b/ui-kit/react/guide-custom-call-screens.mdx new file mode 100644 index 000000000..95d9dd53f --- /dev/null +++ b/ui-kit/react/guide-custom-call-screens.mdx @@ -0,0 +1,215 @@ +--- +title: "Custom Call Screens" +sidebarTitle: "Custom Call Screens" +description: "Draw your own call buttons and call screens while the UI Kit still places, rings, answers and ends calls through the Calls SDK." +--- + +## Goal + +By the end of this guide your app draws its own call buttons and call screens, while the UI Kit still places, rings, answers and ends the calls. Use it when `CometChatCallButtons` and the screens it opens don't fit your design. + +## Prerequisites + +- Calling set up as in [Calling Integration](/ui-kit/react/calling-integration), with the Calls SDK 5.1.1 or later +- `CometChatIncomingCall` rendered once at the root of your app +- [How calls ring](/ui-kit/react/call-features#how-calls-ring): 1:1 calls ring through the Calls SDK, and group calls send a meeting message + +## Components Used + +| Component / API | Purpose | +|:----------------|:--------| +| `useCometChatCallButtons` | Places and cancels calls the way `CometChatCallButtons` does, and says which screen to show | +| `CometChatOutgoingCall` | The outgoing call screen: "Outgoing Call", then "Ringing..." | +| `CometChatOngoingCall` | Joins the call and draws it | +| `useOngoingCall` | Joins the call into an element of your own, for a call screen you draw yourself | +| `CometChatIncomingCall` with `onAccept` | Hands a call the user answers to your app | + +## Step 1: Place calls with `useCometChatCallButtons` + +`useCometChatCallButtons` does what `CometChatCallButtons` does, without drawing anything. Pass a `user` for a 1:1 call, which rings through the Calls SDK, or a `group` for a group call, which sends a meeting message. + +```tsx +import { CometChat } from "@cometchat/chat-sdk-javascript"; +import { useCometChatCallButtons } from "@cometchat/chat-uikit-react"; + +function MyCallButtons({ user }: { user: CometChat.User }) { + const { callButtonsDisabled, initiateAudioCall, initiateVideoCall } = useCometChatCallButtons({ + user, + callSettingsBuilder: { layout: "SIDEBAR" }, + }); + + return ( +
+ + +
+ ); +} +``` + +### Options + +| Option | Type | Description | +| --- | --- | --- | +| `user` | `CometChat.User` | The user to call. Pass either `user` or `group` | +| `group` | `CometChat.Group` | The group to call | +| `callSettingsBuilder` | `SessionSettings` | Settings for a 1:1 call, laid over the kit's defaults when the call is placed; `sessionType` comes from the call's type. Falls back to `GlobalConfig.callSettingsBuilder`. A group call uses the `callSettings` of your `CometChatOngoingCall` instead | +| `onError` | `((error: CometChat.CometChatException) => void) \| null` | Called when placing or cancelling a call fails | + +### Returns + +| Field | Type | Description | +| --- | --- | --- | +| `initiateAudioCall`, `initiateVideoCall` | `() => Promise` | Place a voice or video call | +| `cancelOutgoingCall` | `() => Promise` | Cancel the call while it rings | +| `resetCallState` | `() => void` | Clear the call once its screen closes | +| `callButtonsDisabled` | `boolean` | `true` while a call is being placed or runs, or an incoming call rings. Disable your buttons with it | +| `showOutgoingCallScreen` | `boolean` | Show the outgoing call screen | +| `showOngoingCall` | `boolean` | Show the ongoing call | +| `activeCall` | `CometChat.Call \| null` | The call this hook placed | +| `callSessionId` | `string` | The call's session ID, for `CometChatOngoingCall` | +| `isDirectCalling` | `boolean` | `true` for a group call | +| `isGroupAudioCall` | `boolean` | `true` for a group voice call | + +The app has one call at a time. A call placed from another button or hook shows here only as `callButtonsDisabled`; the other fields describe the call this hook placed. + +## Step 2: Show the outgoing call screen + +While `showOutgoingCallScreen` is `true`, show `CometChatOutgoingCall` and cancel with `cancelOutgoingCall`: + +```tsx +{showOutgoingCallScreen && activeCall && ( + +)} +``` + +The screen reads "Outgoing Call", then "Ringing..." once the callee's device rings. Its title, subtitle, avatar and button can be replaced; see [Outgoing Call](/ui-kit/react/components/outgoing-call). When the callee answers, `showOutgoingCallScreen` turns `false` and `showOngoingCall` turns `true`. When the call is declined, busy, cancelled or not answered, both are `false`. + +## Step 3: Show the ongoing call + +While `showOngoingCall` is `true`, join the call with `CometChatOngoingCall`: + +```tsx +{showOngoingCall && callSessionId && ( + +)} +``` + +For a 1:1 call, `CometChatOngoingCall` joins the session the Calls SDK prepared while the call rang, so the call starts at once. That session's settings were fixed when the call was placed, so `callSettings` passed here don't apply to it; set them on the hook instead. A group call joins with the `callSettings` passed here. + +To draw the call screen around the call yourself, join it with `useOngoingCall` instead. It renders the call into an element you give it, and joins a prepared session the same way: + +```tsx +import { useEffect, useRef } from "react"; +import { useOngoingCall } from "@cometchat/chat-uikit-react"; + +function MyCallScreen({ sessionId, onEnded }: { sessionId: string; onEnded: () => void }) { + const frame = useRef(null); + const { startCall, endCall, isCallActive } = useOngoingCall({ sessionId, onCallEnded: onEnded }); + + useEffect(() => { + if (frame.current) void startCall(frame.current); + }, [startCall]); + + return ( +
+
+ +
+ ); +} +``` + +`useOngoingCall` takes `sessionId`, `isAudioOnly`, `isDirectCalling`, `onCallEnded` and `onError`, and returns `startCall(element)`, `endCall()` (ends the call), `endSession()` (only leaves the session here) and `isCallActive`. + +## Step 4: Answer calls in your own screen + +`CometChatIncomingCall` answers calls and opens its own call screen. To open yours instead, pass `onAccept`. The kit then stops ringing and hands your app the session it prepared while the call rang: + +```tsx +import { useState } from "react"; +import { CometChat } from "@cometchat/chat-sdk-javascript"; +import { CometChatIncomingCall, CometChatOngoingCall } from "@cometchat/chat-uikit-react"; + +function IncomingCalls() { + const [call, setCall] = useState(null); + + return ( + <> + + {call && ( + setCall(null)} + /> + )} + + ); +} +``` + +Leave `onDecline` unset so the kit still declines the call; see [Incoming Call](/ui-kit/react/components/incoming-call#ondecline). To change only how the card looks, use its view props (`itemView`, `titleView` and the rest) and keep the kit's answer. + +## Complete Example + +```tsx +import { CometChat } from "@cometchat/chat-sdk-javascript"; +import { + CometChatOngoingCall, + CometChatOutgoingCall, + useCometChatCallButtons, +} from "@cometchat/chat-uikit-react"; + +export function MyCallButtons({ user }: { user: CometChat.User }) { + const { + activeCall, + callButtonsDisabled, + showOutgoingCallScreen, + showOngoingCall, + callSessionId, + isDirectCalling, + isGroupAudioCall, + initiateAudioCall, + initiateVideoCall, + cancelOutgoingCall, + resetCallState, + } = useCometChatCallButtons({ user, callSettingsBuilder: { layout: "SIDEBAR" } }); + + return ( + <> + + + + {showOutgoingCallScreen && activeCall && ( + + )} + + {showOngoingCall && callSessionId && ( + + )} + + ); +} +``` + +Render `MyCallButtons` where your chat header is, and `IncomingCalls` from Step 4 once at the root of your app. + +## Next Steps + +- [Call Buttons](/ui-kit/react/components/call-buttons) — the ready-made buttons this hook drives +- [Outgoing Call](/ui-kit/react/components/outgoing-call) — customize the outgoing call screen +- [Incoming Call](/ui-kit/react/components/incoming-call) — customize the incoming call card +- [Calling Integration](/ui-kit/react/calling-integration) — call settings and setup From 8f6500b7b47e9988bb33c3b36339379fb129fc3b Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 18:03:06 +0530 Subject: [PATCH 15/23] docs(angular): Calls SDK 5.1.1 and Chat SDK 4.2.1, logout, storage mode, troubleshooting - Integration, quickstart and the API reference name the Calls SDK 5.1.1 or later, which 1:1 calls need, and the Chat SDK peer ^4.2.1. - setCallingEnabled: the Calls SDK reads the logged-in user from the Chat SDK, so the app doesn't log in to it. setStorageMode now reaches the Calls SDK too, unless the app's CallAppSettings sets its own. - Logout ends a call first: a call being placed is cancelled, a joined call is left, and a ringing one stops ringing, which ends a 1:1 call for the caller as unanswered. - Troubleshooting has rows for CALLS_SDK_UNAVAILABLE, a call ending without a call host, late outcomes and older apps ringing on while Connect legacy ringing is off, the callee's logout, busy after an app's own onAccept or onDecline, and calls that don't update conversations. - Each page that names 5.1.1 has a TODO(release) comment, to fill in once the Calls SDK release with the fix is out. - The incoming call page's "Custom Accept and Decline" is its own section, and its related components list the call host. Co-Authored-By: Claude Opus 5.5 --- ui-kit/angular/api-reference/introduction.mdx | 8 +++++--- .../components/cometchat-incoming-call.mdx | 5 ++++- ui-kit/angular/integration.mdx | 13 +++++++++---- ui-kit/angular/methods.mdx | 4 +++- ui-kit/angular/quickstart.mdx | 4 +++- ui-kit/angular/troubleshooting.mdx | 17 ++++++++++++++--- 6 files changed, 38 insertions(+), 13 deletions(-) diff --git a/ui-kit/angular/api-reference/introduction.mdx b/ui-kit/angular/api-reference/introduction.mdx index 306fcbe13..3f0ce6e7b 100644 --- a/ui-kit/angular/api-reference/introduction.mdx +++ b/ui-kit/angular/api-reference/introduction.mdx @@ -72,14 +72,16 @@ const uiKitSettings = new UIKitSettingsBuilder() | `subscribePresenceForFriends()` | — | — | Subscribe to presence updates for friends only | | `subscribePresenceForRoles(roles)` | `string[]` | — | Subscribe to presence updates for specific roles | | `setAutoEstablishSocketConnection(auto)` | `boolean` | `true` | Auto-establish WebSocket connection on init | -| `setCallingEnabled(enabled)` | `boolean` | `false` | Enable voice/video calling. When `true`, the Calls SDK is initialized after login and call buttons become visible in MessageHeader, CallButtons, and CallLogs. When `false` (default), call buttons are hidden and the Calls SDK is not initialized | +| `setCallingEnabled(enabled)` | `boolean` | `false` | Enable voice/video calling. When `true`, the Calls SDK is initialized after login and call buttons become visible in MessageHeader, CallButtons, and CallLogs. The Calls SDK reads the logged-in user from the Chat SDK, so the app doesn't log in to it. When `false` (default), call buttons are hidden and the Calls SDK is not initialized | | `setCallAppSettings(settings)` | `any` | — | Custom `CallAppSettings` for the Calls SDK. Built via `CometChatUIKitCalls.CallAppSettingsBuilder`. If not set, the UIKit builds default settings from `appId` and `region` | -| `setStorageMode(mode)` | `CometChat.StorageMode` | `LOCAL` | Storage mode for the SDK | +| `setStorageMode(mode)` | `CometChat.StorageMode` | `LOCAL` | Storage mode for the Chat SDK and the Calls SDK. The kit passes it to the Calls SDK too, unless your `CallAppSettings` sets its own `storageMode` | | `setAdminHost(host)` | `string` | — | Override the admin host URL | | `setClientHost(host)` | `string` | — | Override the client host URL | +{/* TODO(release): 5.1.1 stands for the first Calls SDK release with the fix the UI Kit needs. */} + - `setCallingEnabled(true)` requires `@cometchat/calls-sdk-javascript` to be installed. Without the Calls SDK package, calling features will not activate even when enabled. + `setCallingEnabled(true)` requires `@cometchat/calls-sdk-javascript` 5.1.1 or later to be installed. Without the Calls SDK package, calling features will not activate even when enabled. On 5.0.x, every 1:1 call fails with the error `CALLS_SDK_UNAVAILABLE`. ## Services diff --git a/ui-kit/angular/components/cometchat-incoming-call.mdx b/ui-kit/angular/components/cometchat-incoming-call.mdx index 7f0f06cc9..110b76bbf 100644 --- a/ui-kit/angular/components/cometchat-incoming-call.mdx +++ b/ui-kit/angular/components/cometchat-incoming-call.mdx @@ -3,6 +3,8 @@ title: "Incoming Call" description: "A standalone Angular component that displays an incoming call notification with accept and decline actions" --- +{/* TODO(release): 5.1.1 stands for the first Calls SDK release with the fix the UI Kit needs. */} + | Field | Value | @@ -115,7 +117,7 @@ export class IncomingCallDemoComponent { | `callDeclined` | `CometChat.Call` | Emitted when the user declines the incoming call. | | `error` | `CometChat.CometChatException` | Emitted on any error during sound playback, accept, or decline, including `CALL_NOT_RINGING` when the call stopped ringing before Accept. | -### Custom Accept and Decline +## Custom Accept and Decline `onAccept` and `onDecline` run instead of the kit's own answer and decline: @@ -226,4 +228,5 @@ acceptCall(call: CometChat.Call): void { - [CometChatOngoingCall](/ui-kit/angular/components/cometchat-outgoing-call) — Rendered automatically after accepting a call - [CometChatCallButtons](/ui-kit/angular/components/cometchat-call-buttons) — Initiates outgoing calls +- [CometChatCallHost](/ui-kit/angular/components/cometchat-call-host) — Draws the answered call's screen - [CometChatListItem](/ui-kit/angular/components/cometchat-user-item) — Used internally to render the caller information diff --git a/ui-kit/angular/integration.mdx b/ui-kit/angular/integration.mdx index dc9fc019d..88c09d185 100644 --- a/ui-kit/angular/integration.mdx +++ b/ui-kit/angular/integration.mdx @@ -4,19 +4,21 @@ sidebarTitle: "Integration" description: "Add CometChat to an Angular app in 6 steps: create project, install, init, login, add CSS, render." --- +{/* TODO(release): 5.1.1 stands for the first Calls SDK release with the fix the UI Kit needs. */} + | Field | Value | | --- | --- | | Package | `@cometchat/chat-uikit-angular` v5 | | Angular | 17–21 (`@angular/core` / `@angular/common` `>=17.0.0 <22.0.0`). Angular 22 is not supported yet — scaffold with `npx @angular/cli@21 new` | -| Peer deps | `@cometchat/chat-sdk-javascript` ^4.2.0, `@cometchat/cards-angular` ^1.0.0, `dompurify` ^3.0.0; optional `@cometchat/calls-sdk-javascript` ^5.0.3 (calling only) | +| Peer deps | `@cometchat/chat-sdk-javascript` ^4.2.1, `@cometchat/cards-angular` ^1.0.0, `dompurify` ^3.0.0; optional `@cometchat/calls-sdk-javascript` ^5.1.1 (calling only) | | Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` | | Login | `CometChatUIKit.login("UID")` — must resolve before rendering components | | Order | `init()` → `login()` → render. Breaking this order = blank screen | | Auth Key | Dev/testing only. Use Auth Token in production | | CSS | Add `node_modules/@cometchat/chat-uikit-angular/styles/css-variables.css` to the `angular.json` styles array, or `@import '../node_modules/@cometchat/chat-uikit-angular/styles/css-variables.css';` in `src/styles.css` (the package `exports` map has no `./styles` entry, so a bare package specifier does not resolve) | -| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and call `.setCallingEnabled(true)` on the builder to enable | +| Calling | Optional. Install `@cometchat/calls-sdk-javascript` 5.1.1 or later and call `.setCallingEnabled(true)` on the builder to enable | @@ -72,12 +74,15 @@ yarn add @cometchat/chat-uikit-angular @cometchat/chat-sdk-javascript @cometchat `@cometchat/chat-sdk-javascript`, `@cometchat/cards-angular` and `dompurify` are required peer dependencies of the UI Kit. Install them explicitly as shown — yarn and older npm versions don't add peer dependencies for you. Don't use `--legacy-peer-deps`: an `ERESOLVE` here almost always means the Angular major is outside 17–21. -If you want voice/video calling, also install: +If you want voice/video calling, also install the Calls SDK, 5.1.1 or later: +{/* TODO(release): the first Calls SDK release with the fix the UI Kit needs. */} ```bash -npm install @cometchat/calls-sdk-javascript +npm install @cometchat/calls-sdk-javascript@^5.1.1 ``` +On 5.0.x, every 1:1 call fails with the error `CALLS_SDK_UNAVAILABLE`. See [Call Features](/ui-kit/angular/call-features). + --- ## Step 3 — Initialize CometChat diff --git a/ui-kit/angular/methods.mdx b/ui-kit/angular/methods.mdx index e2d0acec9..cb677a7ef 100644 --- a/ui-kit/angular/methods.mdx +++ b/ui-kit/angular/methods.mdx @@ -29,7 +29,7 @@ Auth Key is for development/testing only. In production, generate Auth Tokens on | `setAutoEstablishSocketConnection(autoEstablish)` | `boolean` | Control whether the WebSocket connects automatically on init | | `setAdminHost(adminHost)` | `string` | Override the admin API host (custom/on-premise deployments) | | `setClientHost(clientHost)` | `string` | Override the client API host (custom/on-premise deployments) | -| `setStorageMode(storageMode)` | `CometChat.StorageMode` | Set the storage mode for SDK data persistence | +| `setStorageMode(storageMode)` | `CometChat.StorageMode` | Set the storage mode for SDK data persistence. With calling enabled, the kit passes it to the Calls SDK too, unless your `CallAppSettings` sets its own `storageMode` | | `build()` | — | Returns the configured `UIKitSettings` instance | ```typescript expandable @@ -153,6 +153,8 @@ CometChatUIKit.getLoggedinUser() Ends the current user session. +With calling enabled, a call ends first, while the Calls SDK still knows the user: a call this user is placing is cancelled, a call they are in is left, and a call ringing for them stops ringing here. Stopping the ring leaves the session the kit prepared for it, which ends a 1:1 call for the caller too, recorded as unanswered. The kit waits at most 3 seconds for this, then logs out of the Chat SDK, then out of the Calls SDK. + ```typescript import { CometChatUIKit } from '@cometchat/chat-uikit-angular'; diff --git a/ui-kit/angular/quickstart.mdx b/ui-kit/angular/quickstart.mdx index 5672e5e18..fe5cbb13f 100644 --- a/ui-kit/angular/quickstart.mdx +++ b/ui-kit/angular/quickstart.mdx @@ -117,8 +117,10 @@ CometChatUIKit.init(uiKitSettings) console.error('CometChat UIKit initialization failed:', error); }); ``` +{/* TODO(release): 5.1.1 stands for the first Calls SDK release with the fix the UI Kit needs. */} + - To enable voice and video calling, install `@cometchat/calls-sdk-javascript` and add `.setCallingEnabled(true)` to the builder. Without this, call buttons are hidden across all components. See [Call Features](/ui-kit/angular/call-features) for details. + To enable voice and video calling, install `@cometchat/calls-sdk-javascript` 5.1.1 or later and add `.setCallingEnabled(true)` to the builder. Without this, call buttons are hidden across all components. See [Call Features](/ui-kit/angular/call-features) for details. ## Step 5: Login a User diff --git a/ui-kit/angular/troubleshooting.mdx b/ui-kit/angular/troubleshooting.mdx index 3f4f03e02..ce7b729d6 100644 --- a/ui-kit/angular/troubleshooting.mdx +++ b/ui-kit/angular/troubleshooting.mdx @@ -53,12 +53,21 @@ description: "Common failure modes and fixes for the CometChat Angular UIKit." --- +{/* TODO(release): 5.1.1 stands for the first Calls SDK release with the fix the UI Kit needs. */} + ## Calling | Symptom | Cause | Fix | | --- | --- | --- | -| Call buttons not appearing in Message Header | `@cometchat/calls-sdk-javascript` not installed | Run `npm install @cometchat/calls-sdk-javascript` — UIKit auto-detects it | +| Call buttons not appearing in Message Header | `@cometchat/calls-sdk-javascript` not installed, or calling not enabled | Run `npm install @cometchat/calls-sdk-javascript@^5.1.1` and call `.setCallingEnabled(true)` on the builder. See [Call Features](/ui-kit/angular/call-features) | | Incoming call screen not showing | `cometchat-incoming-call` not in the component tree | Render the component at the app root level so it can listen for incoming calls | +| `CALLS_SDK_UNAVAILABLE` when placing or answering a 1:1 call | The Calls SDK is older than 5.1, so it has no ringing flow | Install `@cometchat/calls-sdk-javascript` 5.1.1 or later | +| A call ends when the user opens another chat | No call host, so the call buttons that drew the call's screens were destroyed, and the call with them | Put [``](/ui-kit/angular/components/cometchat-call-host) once at the app root | +| A decline, a cancel or no answer shows a few seconds late | **Connect legacy ringing** is off, so the kit learns of it from the call's status, read every 3 seconds, and from the call's messages | Expected. See [How calls ring](/ui-kit/angular/call-features#how-calls-ring) | +| An app on legacy ringing keeps ringing after the caller cancels | **Connect legacy ringing** is off | Turn it on in the dashboard while some of your users are on legacy ringing. See [The Connect legacy ringing setting](/ui-kit/angular/call-features#the-connect-legacy-ringing-setting) | +| The caller's screen closes, recorded as unanswered, when the callee logs out while the call rings | Logout leaves the session the kit prepared for the ring, and the Calls SDK ends a 1:1 call when anyone leaves it | Expected. The callee's other devices stop ringing too | +| Later 1:1 calls are answered busy after the app's own `onAccept` or `onDecline` | The incoming call card is still up | Close it with `IncomingCallService.setIncomingCall(null)`. See [Custom Accept and Decline](/ui-kit/angular/components/cometchat-incoming-call#custom-accept-and-decline) | +| A call doesn't change the chat's preview or move it up the list | The app's conversation update settings (`CometChat.getConversationUpdateSettings()`) don't let call activities update conversations | Expected: the kit follows those settings. Change them if calls should update conversations | --- @@ -2973,11 +2982,13 @@ try { ##### CometChatUIKitCalls Not Initialized +{/* TODO(release): 5.1.1 stands for the first Calls SDK release with the fix the UI Kit needs. */} + **Problem**: Error message indicating `CometChatUIKitCalls` is not available. **Solutions**: -1. Ensure the `@cometchat/calls-sdk-javascript` package is installed -2. Enable calling on the UI Kit settings. `CometChatUIKit.init()` then loads and initializes the Calls SDK for you and connects it to the logged-in user's session — don't call `CometChatUIKitCalls.init()` yourself: +1. Ensure `@cometchat/calls-sdk-javascript` 5.1.1 or later is installed +2. Enable calling on the UI Kit settings. The kit then loads and initializes the Calls SDK for you after login, and the Calls SDK reads the logged-in user from the Chat SDK — don't call `CometChatUIKitCalls.init()` or log in to the Calls SDK yourself: ```typescript expandable import { CometChatUIKit, UIKitSettingsBuilder } from '@cometchat/chat-uikit-angular'; From e1d1011ed9b6914edd4f3fda236dfceffaef641a Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 18:03:21 +0530 Subject: [PATCH 16/23] docs(react): tighten the decline lines on Call Buttons and Incoming Call A group decline only stops the ring for that user, and the caller's own cancel isn't something the screen hears about. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/components/call-buttons.mdx | 2 +- ui-kit/react/components/incoming-call.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-kit/react/components/call-buttons.mdx b/ui-kit/react/components/call-buttons.mdx index 392ad14eb..95245b05b 100644 --- a/ui-kit/react/components/call-buttons.mdx +++ b/ui-kit/react/components/call-buttons.mdx @@ -207,7 +207,7 @@ A 1:1 call rings through the Calls SDK (see [How calls ring](/ui-kit/react/call- | --- | --- | | The call's Calls SDK session: `onParticipantConnected` | Shows "Ringing..." on the outgoing call screen | | The call's Calls SDK session: `onParticipantJoined` | Transitions to the ongoing call screen | -| The call's Calls SDK session: `onConnectionClosed`, and a read of the call's status every 3 seconds while it rings | Closes the outgoing call screen when the call is declined, busy, cancelled or not answered | +| The call's Calls SDK session: `onConnectionClosed`, and a read of the call's status every 3 seconds while it rings | Closes the outgoing call screen when the call is declined, answered busy or not answered | | An incoming call ringing on the [Incoming Call](/ui-kit/react/components/incoming-call) card | Disables the buttons until the ring stops, to prevent concurrent calls | The Chat SDK's `CallListener` still covers the rest: `onIncomingCallReceived` and `onIncomingCallCancelled` disable and re-enable the buttons for a call from an app on legacy ringing, and `onOutgoingCallAccepted` and `onOutgoingCallRejected` arrive only when **Connect legacy ringing** is on. diff --git a/ui-kit/react/components/incoming-call.mdx b/ui-kit/react/components/incoming-call.mdx index 825c0348d..265d62184 100644 --- a/ui-kit/react/components/incoming-call.mdx +++ b/ui-kit/react/components/incoming-call.mdx @@ -42,7 +42,7 @@ The component handles: - Automatic detection of incoming calls via SDK `CallListener` - Caller avatar, name, and call type display (Voice/Video) - Accept button — answers the call and transitions to `CometChatOngoingCall` internally -- Decline button — declines the call. The user's other tabs and devices stop ringing. A group call only stops ringing here: it goes on for the group's other members +- Decline button — declines the call, and the user's other tabs and devices stop ringing. Declining a group call only stops it ringing for this user: the call goes on for the group's other members - Accept and Decline labels in the user's language (`incoming_call_confirm_yes`, `incoming_call_confirm_no`) - Incoming call sound playback (looping while notification is visible) - Self-managed visibility (renders nothing when no incoming call is active) From c6c1f0de7b04f914979de1109f10bf173ec9b96b Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 18:05:52 +0530 Subject: [PATCH 17/23] docs(react): say that only group calls the kit places skip ringing The incoming call card still rings for a group call another app places. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/call-features.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-kit/react/call-features.mdx b/ui-kit/react/call-features.mdx index d5c297c37..cbd621564 100644 --- a/ui-kit/react/call-features.mdx +++ b/ui-kit/react/call-features.mdx @@ -67,7 +67,7 @@ Call buttons render inside [MessageHeader](/ui-kit/react/components/message-head - If nobody answers within 45 seconds, the caller's kit ends the call as unanswered. - A tab that is already in a call, placing one or ringing for one answers a new 1:1 call busy, without showing it. -Group calls don't ring. The kit sends a meeting message to the group, and members join the call from it. +Group calls that the kit places don't ring. The kit sends a meeting message to the group, and members join the call from it. ### The Connect legacy ringing setting From cc516329e9d4cc4d58e0dac4d1e4cd470b4b9410 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Mon, 23 Nov 2026 18:05:52 +0530 Subject: [PATCH 18/23] docs(angular): name the dashboard setting for call activities Co-Authored-By: Claude Opus 5.5 --- ui-kit/angular/troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-kit/angular/troubleshooting.mdx b/ui-kit/angular/troubleshooting.mdx index ce7b729d6..ea208ff8c 100644 --- a/ui-kit/angular/troubleshooting.mdx +++ b/ui-kit/angular/troubleshooting.mdx @@ -67,7 +67,7 @@ description: "Common failure modes and fixes for the CometChat Angular UIKit." | An app on legacy ringing keeps ringing after the caller cancels | **Connect legacy ringing** is off | Turn it on in the dashboard while some of your users are on legacy ringing. See [The Connect legacy ringing setting](/ui-kit/angular/call-features#the-connect-legacy-ringing-setting) | | The caller's screen closes, recorded as unanswered, when the callee logs out while the call rings | Logout leaves the session the kit prepared for the ring, and the Calls SDK ends a 1:1 call when anyone leaves it | Expected. The callee's other devices stop ringing too | | Later 1:1 calls are answered busy after the app's own `onAccept` or `onDecline` | The incoming call card is still up | Close it with `IncomingCallService.setIncomingCall(null)`. See [Custom Accept and Decline](/ui-kit/angular/components/cometchat-incoming-call#custom-accept-and-decline) | -| A call doesn't change the chat's preview or move it up the list | The app's conversation update settings (`CometChat.getConversationUpdateSettings()`) don't let call activities update conversations | Expected: the kit follows those settings. Change them if calls should update conversations | +| A call doesn't change the chat's preview or move it up the list | The app's conversation update settings (`CometChat.getConversationUpdateSettings()`) don't let call activities update conversations | Expected: the kit follows those settings. Turn on **Include Call Activities** in the dashboard if calls should update conversations | --- From 1acd29419aef28f959f70667345540f40cd56c40 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Wed, 25 Nov 2026 15:27:19 +0530 Subject: [PATCH 19/23] docs(react): one rule for call settings, and fixes from testing the snippets Every call's settings are now laid over the kit's defaults, so the pages drop the group-call and incoming-call exceptions. The snippets take their SDK types as type imports and say which hook values they use, and the conversations page loses two lines that repeated the list's behavior. Co-Authored-By: Claude Opus 5.5 --- ui-kit/react/calling-integration.mdx | 11 +++++----- ui-kit/react/components/call-buttons.mdx | 7 ++----- ui-kit/react/components/call-logs.mdx | 2 +- ui-kit/react/components/conversations.mdx | 3 +-- ui-kit/react/components/incoming-call.mdx | 23 ++------------------- ui-kit/react/components/message-header.mdx | 4 ++-- ui-kit/react/components/outgoing-call.mdx | 8 +++---- ui-kit/react/guide-custom-call-screens.mdx | 16 +++++++------- ui-kit/react/migration-property-changes.mdx | 2 +- 9 files changed, 26 insertions(+), 50 deletions(-) diff --git a/ui-kit/react/calling-integration.mdx b/ui-kit/react/calling-integration.mdx index 1ad7f67f5..3df54b8c4 100644 --- a/ui-kit/react/calling-integration.mdx +++ b/ui-kit/react/calling-integration.mdx @@ -76,9 +76,9 @@ The Calls SDK uses the same `appId` and `region` from your `UIKitSettings` — n The `config` prop on `CometChatProvider` accepts a `CometChatGlobalConfig` object for UI/behavior flags (`hideReceipts`, `hideUserStatus`, `disableSoundForCalls`, `customSoundForCalls`, `callSettingsBuilder`). It does **not** take a separate calling app ID or region. -### Settings for 1:1 calls +### Call settings -A 1:1 call's session is set up when the call is placed, on the caller's side, and when it starts ringing, on the callee's. At that moment the kit lays `callSettingsBuilder` over its own defaults, so set only what you want to change: +Every call's session settings are `callSettingsBuilder` laid over the kit's own defaults, so set only what you want to change. A component's own `callSettingsBuilder`, such as `CometChatCallButtons`' or `CometChatIncomingCall`'s, takes the place of this one for the calls it places or answers: ```tsx @@ -86,9 +86,8 @@ A 1:1 call's session is set up when the call is placed, on the caller's side, an ``` -- `sessionType` comes from the button pressed (voice or video), and `isPeerCall` is always on, so a hang-up ends the call for both people. -- Settings given later, for example to your own `CometChatOngoingCall`, don't reach a call that is already set up. -- Group calls are unchanged: their settings replace the defaults. +- `sessionType` comes from the call: the button pressed (voice or video), or the type of the call answered. +- A 1:1 call's session is set up when the call is placed, on the caller's side, and when it starts ringing, on the callee's, so set its settings here or on the component that places or answers it. `isPeerCall` is always on for it, so a hang-up ends the call for both people. ## Step 4: Add Call Buttons via CometChatMessageHeader @@ -269,7 +268,7 @@ function Calls() { } ``` -The call's settings were fixed when it started ringing (see Step 3), so `callSettings` passed to this `CometChatOngoingCall` don't apply. Pass `onDecline` only if your app declines the call itself: the kit then just stops ringing and leaves the session it prepared, which ends a 1:1 call for the caller as unanswered. +The call's session was set up when it started ringing, with the settings from Step 3, so set them there rather than on this `CometChatOngoingCall`. Pass `onDecline` only if your app declines the call itself: the kit then just stops ringing and leaves the session it prepared, which ends a 1:1 call for the caller as unanswered. `CometChatOutgoingCall` is rendered automatically by the `CometChatCallButtons` component when the user initiates a call — you do not need to place it manually. diff --git a/ui-kit/react/components/call-buttons.mdx b/ui-kit/react/components/call-buttons.mdx index 95245b05b..aada25452 100644 --- a/ui-kit/react/components/call-buttons.mdx +++ b/ui-kit/react/components/call-buttons.mdx @@ -232,10 +232,7 @@ function CallButtonsCustomSettings({ chatUser }: { chatUser: User }) { } ``` -How the object is used depends on the call: - -- **1:1 calls:** the session is set up when the call is placed, and the kit lays the object over its own defaults, so set only what you change. `sessionType` comes from the button pressed, and `isPeerCall` is always on, so a hang-up ends the call for both people. Settings given later, for example to your own `CometChatOngoingCall`, don't reach the call. -- **Group calls:** `CometChatCallButtons` passes the object unchanged to the internal `CometChatOngoingCall` as its `callSettings`. It replaces the built-in defaults, including the `sessionType` the component would pick for a voice call (`"VOICE"`). Set `sessionType` yourself if the same settings must also serve voice calls, or hide the button that doesn't match. +The kit lays the object over its own defaults, so set only what you change, and `sessionType` comes from the button pressed. A 1:1 call's session is set up when the call is placed, so its settings come from here or the provider; `isPeerCall` is always on for it, so a hang-up ends the call for both people. --- @@ -364,7 +361,7 @@ All props are optional. Sorted alphabetically. ### callSettingsBuilder -Session settings for the call this component starts. For a 1:1 call they are laid over the kit's defaults when the call is placed; for a group call they are passed unchanged to `CometChatOngoingCall` as `callSettings`, replacing the defaults. Falls back to `GlobalConfig.callSettingsBuilder`. See [Call Settings](#call-settings). +Session settings for the calls this component starts, laid over the kit's defaults, with `sessionType` from the button pressed. Falls back to `GlobalConfig.callSettingsBuilder`. See [Call Settings](#call-settings). | | | | --- | --- | diff --git a/ui-kit/react/components/call-logs.mdx b/ui-kit/react/components/call-logs.mdx index f5ea58b37..83284317d 100644 --- a/ui-kit/react/components/call-logs.mdx +++ b/ui-kit/react/components/call-logs.mdx @@ -279,7 +279,7 @@ Callback when an SDK error occurs during fetch operations. ### callSettingsBuilder -Session settings (`SessionSettings`) for calls placed from the call logs. The call logs place calls with `CometChatCallButtons`, so they ring the same way, and their settings are laid over the kit's defaults when the call is placed, with `sessionType` from the call's type. Falls back to `GlobalConfig.callSettingsBuilder`, then default settings. See [Call Settings](/ui-kit/react/components/call-buttons#call-settings). +Session settings (`SessionSettings`) for calls placed from the call logs. The call logs place calls with `CometChatCallButtons`, so they ring the same way, and their settings are laid over the kit's defaults, with `sessionType` from the call's type. Falls back to `GlobalConfig.callSettingsBuilder`. See [Call Settings](/ui-kit/react/components/call-buttons#call-settings). | | | | --- | --- | diff --git a/ui-kit/react/components/conversations.mdx b/ui-kit/react/components/conversations.mdx index 9ce3ac4a2..1cc441c6a 100644 --- a/ui-kit/react/components/conversations.mdx +++ b/ui-kit/react/components/conversations.mdx @@ -369,9 +369,8 @@ These SDK listeners are attached internally. The component updates its state aut Calls change the list only when the app's conversation update settings let call activities update conversations (**Include Call Activities** in the dashboard; read it with `CometChatUIKit.getConversationUpdateSettings()?.shouldUpdateOnCallActivities()`). Then: -- The chat's preview says how the call went, from the user's side. For the caller: Outgoing Call, Call Answered, Call Ended, Call Canceled, Call Rejected, Call Unanswered or Call Busy. For the person called: Incoming Call, Call Answered, Call Ended, or Missed Call for a call they didn't take. - A call moves the chat up but keeps its unread count. -- After a 1:1 call on the ringing flow ends, the list fetches the chat a few times, for up to about 25 seconds, until its last message shows how the call went. With **Connect legacy ringing** off, those messages reach no tab live (see [How calls ring](/ui-kit/react/call-features#how-calls-ring)). The chat is placed by that message's time, so it doesn't jump above newer chats, and pinned chats keep their place. +- After a 1:1 call on the ringing flow ends, the list fetches the chat a few times, for up to about 25 seconds, until its last message shows how the call went. With **Connect legacy ringing** off, those messages reach no tab live (see [How calls ring](/ui-kit/react/call-features#how-calls-ring)). When call activities don't update conversations, calls leave the list as it is. diff --git a/ui-kit/react/components/incoming-call.mdx b/ui-kit/react/components/incoming-call.mdx index 265d62184..dd2a6c3b3 100644 --- a/ui-kit/react/components/incoming-call.mdx +++ b/ui-kit/react/components/incoming-call.mdx @@ -275,7 +275,7 @@ All props are optional. `Call` and `CometChatException` in the types below are t ### onAccept -Custom accept handler. When provided, the kit doesn't answer the call: it stops ringing and hands your app the session it prepared while the call rang. Join it with `CometChatOngoingCall` (or `useOngoingCall`); see the example in [Calling Integration](/ui-kit/react/calling-integration#step-7-render-cometchatincomingcall). The call's settings were fixed when it started ringing, so settings passed to that `CometChatOngoingCall` don't apply. For a call from an app on legacy ringing, it replaces `CometChat.acceptCall`, as before. +Custom accept handler. When provided, the kit doesn't answer the call: it stops ringing and hands your app the session it prepared while the call rang. Join it with `CometChatOngoingCall` (or `useOngoingCall`); see the example in [Calling Integration](/ui-kit/react/calling-integration#step-7-render-cometchatincomingcall). The call's session was set up when it started ringing, with this component's `callSettingsBuilder` or the provider's, so set its settings there rather than on that `CometChatOngoingCall`. For a call from an app on legacy ringing, it replaces `CometChat.acceptCall`, as before. To run your own code when the user answers, and keep the kit's answer, listen for `ui:call/accepted` instead. @@ -336,32 +336,13 @@ Custom sound URL to play for incoming calls (replaces the built-in ringtone). Customizes the session of a call this component answers: a function that receives the call and returns session settings (`SessionSettings`, the same object [`CometChatCallButtons`](/ui-kit/react/components/call-buttons#call-settings) takes). Falls back to `GlobalConfig.callSettingsBuilder`. -For a 1:1 call on the ringing flow, the session is set up when the call starts ringing, and the kit lays these settings over its own defaults then. `sessionType` comes from the call's type, and `isPeerCall` is always on. +The kit lays these settings over its own defaults, and `sessionType` comes from the call's type. For a 1:1 call on the ringing flow, the session is set up when the call starts ringing, and `isPeerCall` is always on. | | | | --- | --- | | Type | `(call: Call) => SessionSettings` | | Default | `undefined` | - -For a call from an app on legacy ringing, the value this function returns is not applied: `CometChatIncomingCall` hands it to the ongoing call under a prop name the ongoing call does not read, so such a call uses the global or default settings. To cover those calls too, set session settings on `CometChatProvider`, which the ongoing call does read: - -```tsx -import { CometChatProvider, type SessionSettings } from "@cometchat/chat-uikit-react"; - -const callSettings: SessionSettings = { - layout: "SIDEBAR", - startVideoPaused: true, -}; - - - {/* ...your app, including */} - -``` - -`CometChat.CallSettingsBuilder` belongs to the older Calls SDK v4 integration; v7 calling takes a plain `SessionSettings` object. - - --- ### onError diff --git a/ui-kit/react/components/message-header.mdx b/ui-kit/react/components/message-header.mdx index 5dc2fabde..6c52fe2c6 100644 --- a/ui-kit/react/components/message-header.mdx +++ b/ui-kit/react/components/message-header.mdx @@ -30,7 +30,7 @@ description: "Toolbar displaying conversation details with avatar, name, presenc "callSettingsBuilder": { "type": "SessionSettings (typed any in the 7.2.4 declarations)", "default": "GlobalConfig.callSettingsBuilder or built-in default", - "note": "Session-settings object (not a function) for calls started from the header; passed unchanged to CometChatCallButtons, which hands it to CometChatOngoingCall as callSettings." + "note": "Session-settings object (not a function) for calls started from the header; passed to CometChatCallButtons, which lays it over the kit's defaults." }, "lastActiveAtDateTimeFormat": { "type": "CometChatDateFormatConfig", @@ -703,7 +703,7 @@ Remove the "Pinned messages" entry from the overflow menu. The entry only appear ### callSettingsBuilder -Session settings for calls started from the header's call buttons. In v7 this prop takes a session-settings **object** (`SessionSettings`), not a builder function: the header passes it unchanged to `CometChatCallButtons`. A 1:1 call's settings are laid over the kit's defaults when the call is placed, with `sessionType` from the button pressed; a group call's are handed to `CometChatOngoingCall` as `callSettings` and replace the defaults. Falls back to `GlobalConfig.callSettingsBuilder`, then the built-in default. See [Call Settings](/ui-kit/react/components/call-buttons#call-settings). +Session settings for calls started from the header's call buttons. In v7 this prop takes a session-settings **object** (`SessionSettings`), not a builder function: the header passes it unchanged to `CometChatCallButtons`, which lays it over the kit's defaults, with `sessionType` from the button pressed. Falls back to `GlobalConfig.callSettingsBuilder`, then the built-in default. See [Call Settings](/ui-kit/react/components/call-buttons#call-settings). | | | | --- | --- | diff --git a/ui-kit/react/components/outgoing-call.mdx b/ui-kit/react/components/outgoing-call.mdx index 96583f612..043a25739 100644 --- a/ui-kit/react/components/outgoing-call.mdx +++ b/ui-kit/react/components/outgoing-call.mdx @@ -53,10 +53,10 @@ The component handles: ### Flat API ```tsx -import type { CometChat } from "@cometchat/chat-sdk-javascript"; +import type { Call } from "@cometchat/chat-sdk-javascript"; import { CometChatOutgoingCall } from "@cometchat/chat-uikit-react"; -function OutgoingCallScreen({ call, onCancel }: { call: CometChat.Call; onCancel: () => void }) { +function OutgoingCallScreen({ call, onCancel }: { call: Call; onCancel: () => void }) { return ; } ``` @@ -68,14 +68,14 @@ function OutgoingCallScreen({ call, onCancel }: { call: CometChat.Call; onCancel To place and cancel a call the way the kit does, so that it rings through the Calls SDK, use the `useCometChatCallButtons` hook. It places the call, gives you `activeCall` for this screen and `cancelOutgoingCall` for its button, and tells you when to show the ongoing call: ```tsx -import { CometChat } from "@cometchat/chat-sdk-javascript"; +import type { User } from "@cometchat/chat-sdk-javascript"; import { CometChatOngoingCall, CometChatOutgoingCall, useCometChatCallButtons, } from "@cometchat/chat-uikit-react"; -function CallManager({ user }: { user: CometChat.User }) { +function CallManager({ user }: { user: User }) { const { activeCall, callButtonsDisabled, diff --git a/ui-kit/react/guide-custom-call-screens.mdx b/ui-kit/react/guide-custom-call-screens.mdx index 95d9dd53f..58d4c0036 100644 --- a/ui-kit/react/guide-custom-call-screens.mdx +++ b/ui-kit/react/guide-custom-call-screens.mdx @@ -29,10 +29,10 @@ By the end of this guide your app draws its own call buttons and call screens, w `useCometChatCallButtons` does what `CometChatCallButtons` does, without drawing anything. Pass a `user` for a 1:1 call, which rings through the Calls SDK, or a `group` for a group call, which sends a meeting message. ```tsx -import { CometChat } from "@cometchat/chat-sdk-javascript"; +import type { User } from "@cometchat/chat-sdk-javascript"; import { useCometChatCallButtons } from "@cometchat/chat-uikit-react"; -function MyCallButtons({ user }: { user: CometChat.User }) { +function MyCallButtons({ user }: { user: User }) { const { callButtonsDisabled, initiateAudioCall, initiateVideoCall } = useCometChatCallButtons({ user, callSettingsBuilder: { layout: "SIDEBAR" }, @@ -53,7 +53,7 @@ function MyCallButtons({ user }: { user: CometChat.User }) { | --- | --- | --- | | `user` | `CometChat.User` | The user to call. Pass either `user` or `group` | | `group` | `CometChat.Group` | The group to call | -| `callSettingsBuilder` | `SessionSettings` | Settings for a 1:1 call, laid over the kit's defaults when the call is placed; `sessionType` comes from the call's type. Falls back to `GlobalConfig.callSettingsBuilder`. A group call uses the `callSettings` of your `CometChatOngoingCall` instead | +| `callSettingsBuilder` | `SessionSettings` | Settings for a 1:1 call, laid over the kit's defaults when the call is placed; `sessionType` comes from the call's type. Falls back to `GlobalConfig.callSettingsBuilder`. A group call joins with your `CometChatOngoingCall`'s settings instead | | `onError` | `((error: CometChat.CometChatException) => void) \| null` | Called when placing or cancelling a call fails | ### Returns @@ -75,7 +75,7 @@ The app has one call at a time. A call placed from another button or hook shows ## Step 2: Show the outgoing call screen -While `showOutgoingCallScreen` is `true`, show `CometChatOutgoingCall` and cancel with `cancelOutgoingCall`: +Take `showOutgoingCallScreen`, `activeCall` and `cancelOutgoingCall` from the same hook. While `showOutgoingCallScreen` is `true`, show `CometChatOutgoingCall` and cancel with `cancelOutgoingCall`: ```tsx {showOutgoingCallScreen && activeCall && ( @@ -87,7 +87,7 @@ The screen reads "Outgoing Call", then "Ringing..." once the callee's device rin ## Step 3: Show the ongoing call -While `showOngoingCall` is `true`, join the call with `CometChatOngoingCall`: +Take `showOngoingCall`, `callSessionId`, `isGroupAudioCall`, `isDirectCalling` and `resetCallState` from the hook as well. While `showOngoingCall` is `true`, join the call with `CometChatOngoingCall`. This step uses `CometChat.CALL_TYPE`, a value, so import `CometChat` with `import { CometChat } from "@cometchat/chat-sdk-javascript"`: ```tsx {showOngoingCall && callSessionId && ( @@ -100,7 +100,7 @@ While `showOngoingCall` is `true`, join the call with `CometChatOngoingCall`: )} ``` -For a 1:1 call, `CometChatOngoingCall` joins the session the Calls SDK prepared while the call rang, so the call starts at once. That session's settings were fixed when the call was placed, so `callSettings` passed here don't apply to it; set them on the hook instead. A group call joins with the `callSettings` passed here. +For a 1:1 call, `CometChatOngoingCall` joins the session the Calls SDK prepared while the call rang, so the call starts at once. That session was set up with the hook's settings when the call was placed, so set them on the hook. A group call joins with the `callSettings` passed here, else the provider's, laid over the kit's defaults. To draw the call screen around the call yourself, join it with `useOngoingCall` instead. It renders the call into an element you give it, and joins a prepared session the same way: @@ -127,7 +127,7 @@ function MyCallScreen({ sessionId, onEnded }: { sessionId: string; onEnded: () = } ``` -`useOngoingCall` takes `sessionId`, `isAudioOnly`, `isDirectCalling`, `onCallEnded` and `onError`, and returns `startCall(element)`, `endCall()` (ends the call), `endSession()` (only leaves the session here) and `isCallActive`. +`useOngoingCall` takes `sessionId`, `isAudioOnly`, `isDirectCalling`, `callSettings` (laid over the kit's defaults; falls back to the provider's), `onCallEnded` and `onError`, and returns `startCall(element)`, `endCall()` (ends the call), `endSession()` (only leaves the session here) and `isCallActive`. ## Step 4: Answer calls in your own screen @@ -205,7 +205,7 @@ export function MyCallButtons({ user }: { user: CometChat.User }) { } ``` -Render `MyCallButtons` where your chat header is, and `IncomingCalls` from Step 4 once at the root of your app. +Render `MyCallButtons` where your chat header is, and `IncomingCalls` from Step 4 once at the root of your app, in place of the `CometChatIncomingCall` from the prerequisites. ## Next Steps diff --git a/ui-kit/react/migration-property-changes.mdx b/ui-kit/react/migration-property-changes.mdx index 546431d92..383841b62 100644 --- a/ui-kit/react/migration-property-changes.mdx +++ b/ui-kit/react/migration-property-changes.mdx @@ -294,7 +294,7 @@ A v6 formatter that relied on that inherited behaviour compiles, and then does n | `onSummaryClick` | `() => void` | 7.0.0 | Summary button click | | `onVoiceCallClick` | `(entity: User \| Group) => void` | 7.0.0 | Voice call button click | | `onVideoCallClick` | `(entity: User \| Group) => void` | 7.0.0 | Video call button click | -| `callSettingsBuilder` | `SessionSettings` (typed `any` in the 7.2.4 declarations) | 7.0.0 | Session settings **object** (not a builder function) for calls started from the header, passed unchanged to `CometChatCallButtons`. A 1:1 call's settings are laid over the kit's defaults when the call is placed; a group call's go to `CometChatOngoingCall` as `callSettings` — see [Message Header](/ui-kit/react/components/message-header#callsettingsbuilder) | +| `callSettingsBuilder` | `SessionSettings` (typed `any` in the 7.2.4 declarations) | 7.0.0 | Session settings **object** (not a builder function) for calls started from the header, passed unchanged to `CometChatCallButtons`, which lays them over the kit's defaults — see [Message Header](/ui-kit/react/components/message-header#callsettingsbuilder) | --- From 9016b64dcb0c9fe5009d8eb78e03cf3a2b1aabb4 Mon Sep 17 00:00:00 2001 From: PrajwalDhuleCC Date: Wed, 25 Nov 2026 15:27:27 +0530 Subject: [PATCH 20/23] docs(angular): one rule for call settings, and fixes from testing the snippets Every call's settings are now laid over the kit's defaults, so the pages drop the group-call exception. The outgoing call page's standalone example, which the kit's own outgoing screen covers when a call host is in place, becomes a note on what the kit draws, and the call buttons table gains `hideOverlays`. The incoming call example loses the subtitle template, which gets no context from the card yet, and the snippets compile as written. Co-Authored-By: Claude Opus 5.5 --- ui-kit/angular/call-features.mdx | 2 +- .../components/cometchat-call-buttons.mdx | 10 ++--- .../components/cometchat-call-host.mdx | 2 +- .../components/cometchat-call-logs.mdx | 4 +- .../components/cometchat-incoming-call.mdx | 17 ++++---- .../components/cometchat-message-header.mdx | 4 +- .../components/cometchat-outgoing-call.mdx | 40 +++---------------- .../angular/customization/global-config.mdx | 17 ++++---- 8 files changed, 30 insertions(+), 66 deletions(-) diff --git a/ui-kit/angular/call-features.mdx b/ui-kit/angular/call-features.mdx index b502d124b..76d66b0f2 100644 --- a/ui-kit/angular/call-features.mdx +++ b/ui-kit/angular/call-features.mdx @@ -43,7 +43,7 @@ When enabled, [cometchat-call-buttons](/ui-kit/angular/components/cometchat-call ### Add the incoming call card and the call host -Put [cometchat-incoming-call](/ui-kit/angular/components/cometchat-incoming-call) and [cometchat-call-host](/ui-kit/angular/components/cometchat-call-host) once in your root component, next to the router outlet: +Put [cometchat-incoming-call](/ui-kit/angular/components/cometchat-incoming-call) and [cometchat-call-host](/ui-kit/angular/components/cometchat-call-host) once in your root component, next to the router outlet, and add `RouterOutlet`, `CometChatIncomingCallComponent` and `CometChatCallHostComponent` to its `imports`: ```html diff --git a/ui-kit/angular/components/cometchat-call-buttons.mdx b/ui-kit/angular/components/cometchat-call-buttons.mdx index e48e938ad..3f08192a6 100644 --- a/ui-kit/angular/components/cometchat-call-buttons.mdx +++ b/ui-kit/angular/components/cometchat-call-buttons.mdx @@ -95,7 +95,8 @@ export class CallButtonsDemoComponent { | `onError` | `((error: CometChat.CometChatException) => void) \| null` | `null` | Error callback invoked for any error during call operations. | | `outgoingCallDisableSoundForCalls` | `boolean` | `false` | Disables sound for the outgoing call overlay. Supports global config override. | | `outgoingCallCustomSoundForCalls` | `string` | `''` | Custom sound URL for the outgoing call overlay. Supports global config override. | -| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object for the call screen. For a 1:1 call it is laid over the kit's defaults when the call is placed; for a group call it replaces them. See [Custom Call Settings](#custom-call-settings). Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | +| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object for the call screen. It is laid over the kit's defaults, with `sessionType` from the button pressed. See [Custom Call Settings](#custom-call-settings). Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | +| `hideOverlays` | `boolean` | `false` | When `true`, these buttons don't draw the outgoing and ongoing call screens for the calls they place. A [cometchat-call-host](/ui-kit/angular/components/cometchat-call-host) still draws them. | | `voiceCallButtonView` | `TemplateRef \| null` | `null` | Replaces the default voice call button with a custom template. | | `videoCallButtonView` | `TemplateRef \| null` | `null` | Replaces the default video call button with a custom template. | @@ -137,7 +138,7 @@ cometchat-call-buttons { ### Custom Call Settings -Pass a plain v5 `SessionSettings` object to customize the call screen. It isn't a builder: the kit reads the object as it is. +Pass a plain v5 `SessionSettings` object to customize the call screen. It isn't a builder: the kit lays the object over its own defaults, so you set only what you change. ```typescript expandable import { Component } from '@angular/core'; @@ -167,10 +168,7 @@ export class CustomCallSettingsComponent { } ``` -How the object applies depends on the call: - -- **1:1 calls:** the object is laid over the kit's defaults, so you set only what you change. `sessionType` comes from the button pressed (voice or video), and `isPeerCall` is always on, so hanging up ends the call for both people. The settings are fixed when the call is placed, so a change made while it rings or runs doesn't reach that call. -- **Group calls:** the object replaces the kit's defaults, so include every setting you need, such as `sessionType`. +The kit lays the object over its own defaults, and `sessionType` comes from the button pressed (voice or video). A 1:1 call's settings are fixed when the call is placed, so a change made while it rings or runs doesn't reach that call; `isPeerCall` is always on for it, so hanging up ends the call for both people. You can also set `callSettingsBuilder` globally via [GlobalConfig](/ui-kit/angular/customization/global-config) so all call components use the same settings without passing the input to each one. diff --git a/ui-kit/angular/components/cometchat-call-host.mdx b/ui-kit/angular/components/cometchat-call-host.mdx index 54547ec51..289ed56d9 100644 --- a/ui-kit/angular/components/cometchat-call-host.mdx +++ b/ui-kit/angular/components/cometchat-call-host.mdx @@ -57,7 +57,7 @@ import { `, }) -export class AppComponent {} +export class App {} ``` diff --git a/ui-kit/angular/components/cometchat-call-logs.mdx b/ui-kit/angular/components/cometchat-call-logs.mdx index a5a9ffa7d..3a19ef797 100644 --- a/ui-kit/angular/components/cometchat-call-logs.mdx +++ b/ui-kit/angular/components/cometchat-call-logs.mdx @@ -155,7 +155,7 @@ When `callButtonClicked` has no observers, clicking the trailing call button aut | `callLogRequestBuilder` | `any` | `null` | Custom `CallLogRequestBuilder` from `CometChatCalls`. When provided, overrides the default builder (limit 30, category "call"). | | `callInitiatedDateTimeFormat` | `CalendarObject \| null` | `null` | Custom date format for the call initiation timestamp. Merged with global and default `CalendarObject` formats (component-level wins). | | `showScrollbar` | `boolean` | `false` | Whether to show the scrollbar on the call logs list. | -| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object for the calls placed from the call logs. It is laid over the kit's defaults when the call is placed. See [Custom Call Settings](#custom-call-settings). Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | +| `callSettingsBuilder` | `SessionSettings` | `undefined` | A plain v5 `SessionSettings` object for the calls placed from the call logs. It is laid over the kit's defaults, with `sessionType` from the call's type. See [Custom Call Settings](#custom-call-settings). Follows the three-tier priority: @Input > [GlobalConfig](/ui-kit/angular/customization/global-config) > default. | | `onError` | `((error: CometChat.CometChatException) => void) \| null` | `null` | Error callback invoked when any error occurs during operations such as fetching call logs or initiating calls. | ### Template Properties @@ -322,7 +322,7 @@ export class ActiveCallLogsComponent { ### Custom Call Settings -Pass a plain v5 `SessionSettings` object for calls placed from the call logs. It isn't a builder: the kit reads the object as it is. +Pass a plain v5 `SessionSettings` object for calls placed from the call logs. It isn't a builder: the kit lays the object over its own defaults, so you set only what you change. ```typescript expandable import { Component } from '@angular/core'; diff --git a/ui-kit/angular/components/cometchat-incoming-call.mdx b/ui-kit/angular/components/cometchat-incoming-call.mdx index 110b76bbf..7bb8e35f1 100644 --- a/ui-kit/angular/components/cometchat-incoming-call.mdx +++ b/ui-kit/angular/components/cometchat-incoming-call.mdx @@ -139,7 +139,7 @@ import { CometChatIncomingCallComponent, IncomingCallService } from '@cometchat/ imports: [CometChatIncomingCallComponent], template: ` -
+
` }) export class CustomIncomingCallComponent { @@ -172,15 +172,7 @@ cometchat-incoming-call { ### Custom Templates ```html expandable - - - {{ ctx.callType === 'video' ? '📹 Video Call' : '📞 Audio Call' }} - - +