Goal
By the end of this guide you will have voice and video calling working in your React app — including theCometChatCallButtons component, incoming call notifications, and outgoing call screens.
Prerequisites
- A working CometChat React UI Kit v7 setup (completed the Integration Guide)
CometChatUIKit.init()andlogin()completed before rendering- A CometChat plan that includes calling features enabled in your dashboard
Step 1: Install the Calls SDK
The calling feature requires the optional@cometchat/calls-sdk-javascript peer dependency:
Step 2: Enable Calling in UIKitSettingsBuilder
Set.setCallingEnabled(true) on your UIKitSettingsBuilder during initialization:
src/main.tsx
- Registers the
CallingPluginfor call-related message rendering - Lazy-loads call components (
CometChatIncomingCall,CometChatOutgoingCall,CometChatOngoingCall) only when needed - Enables the
CometChatCallButtonscomponent to initiate calls
CometChatCallButtons renders nothing.
Step 3: Configure call settings
The Calls SDK uses the sameappId and region from your UIKitSettings — no separate configuration is needed. The UI Kit passes these credentials to the Calls SDK automatically when calling is enabled.
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.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:
hideVoiceCallButton or hideVideoCallButton:
group prop instead:
CometChatMessageHeader renders its call buttons automatically (via the CometChatMessageHeader.CallButtons sub-component) — you don’t import or render that sub-component separately. If you need call buttons outside the header, use the standalone CometChatCallButtons component.Step 5: Verify with a voice call
With the setup complete, test a voice call:- Open your app with two different users in separate browser tabs
- Click the voice call button (phone icon) in the chat header
- The caller sees the
CometChatOutgoingCallscreen with a “Calling…” indicator - The receiver sees the
CometChatIncomingCalloverlay with accept/reject buttons - Once accepted, both users enter the
CometChatOngoingCallview with live audio
Step 6: Verify with a video call
Video calls work identically — click the video call button (camera icon) instead. TheCometChatOngoingCall component renders a full video interface with:
- Local and remote video streams
- Mute/unmute audio toggle
- Camera on/off toggle
- End call button
Step 7: Render CometChatIncomingCall
CometChatIncomingCall must be rendered in your app — it is NOT auto-rendered by the UI Kit. Place it at the root level of your authenticated layout so it can display the incoming call overlay from anywhere:
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:
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 |
| 2 | Set .setCallingEnabled(true) on UIKitSettingsBuilder |
| 3 | (Optional) Configure call behavior via config prop on CometChatProvider |
| 4 | Call buttons appear in CometChatMessageHeader automatically |
| 5 | Test voice calls between two users |
| 6 | Test video calls between two users |
| 7 | (Optional) Customize incoming/outgoing call handlers |
Next Steps
- Message Header — full props reference including call button visibility
- Call Logs — display call history
- CometChatProvider — all provider configuration options