Skip to main content
npm install @cometchat/calls-sdk-javascript
import { CometChatCalls } from "@cometchat/calls-sdk-javascript";

const callAppSetting = new CometChatCalls.CallAppSettingsBuilder()
  .setAppId("APP_ID")
  .setRegion("REGION")
  .build();

CometChatCalls.init(callAppSetting).then(() => console.log("Calls SDK ready"));
Required: App ID, Region from CometChat Dashboard
The Calls SDK handles the media layer for voice and video calls — camera, microphone, screen sharing, and the call UI. It’s a separate package from the Chat SDK and requires its own initialization.

Prerequisites

You need your App ID and Region from the CometChat Dashboard. If you haven’t created an app yet, sign up and create one. If you’re using the Chat SDK alongside (i.e., not Standalone Calling), make sure CometChat.init() completes before calling CometChatCalls.init().

Installation

npm install @cometchat/calls-sdk-javascript
Then import wherever needed:
import { CometChatCalls } from "@cometchat/calls-sdk-javascript";

Initialization

Call CometChatCalls.init() on app startup, after the Chat SDK has initialized (if you’re using it). The method takes a CallAppSettings object built with CallAppSettingsBuilder.
let appID: string = "APP_ID";
let region: string = "REGION";

const callAppSetting: CometChatCalls.CallAppSettings =
  new CometChatCalls.CallAppSettingsBuilder()
    .setAppId(appID)
    .setRegion(region)
    .build();

CometChatCalls.init(callAppSetting).then(
  () => {
    console.log("CometChatCalls initialization completed successfully");
  },
  (error: unknown) => {
    console.log("CometChatCalls initialization failed with error:", error);
  }
);
Replace APP_ID and REGION with your credentials from the Dashboard.
CometChatCalls.init() must be called before any other Calls SDK method. Calling generateToken(), startSession(), or registering listeners before init() will fail.

CallAppSettings Options

MethodDescription
setAppId(appID)Your CometChat App ID. Required.
setRegion(region)The region where your app was created. Required.
setHost(host)Custom client URL for dedicated deployments. Optional.

Initialization Order

If you’re using both the Chat SDK and Calls SDK, initialize them in sequence:
// 1. Chat SDK first
await CometChat.init(appID, appSettings);

// 2. Then Calls SDK
const callAppSetting: CometChatCalls.CallAppSettings = new CometChatCalls.CallAppSettingsBuilder()
  .setAppId(appID)
  .setRegion(region)
  .build();

await CometChatCalls.init(callAppSetting);

// 3. Now both SDKs are ready
For Standalone Calling, you only need CometChatCalls.init() — no Chat SDK required.

Next Steps

Default Calling

Implement the complete ringing call flow

Call Session

Start and manage call sessions

Standalone Calling

Use Calls SDK without the Chat SDK

Calling Overview

Compare calling approaches and features