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.
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().
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 = "APP_ID";let region = "REGION";const callAppSetting = new CometChatCalls.CallAppSettingsBuilder() .setAppId(appID) .setRegion(region) .build();CometChatCalls.init(callAppSetting).then( () => { console.log("CometChatCalls initialization completed successfully"); }, (error) => { 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.
If you’re using both the Chat SDK and Calls SDK, initialize them in sequence:
TypeScript
JavaScript
// 1. Chat SDK firstawait CometChat.init(appID, appSettings);// 2. Then Calls SDKconst callAppSetting: CometChatCalls.CallAppSettings = new CometChatCalls.CallAppSettingsBuilder() .setAppId(appID) .setRegion(region) .build();await CometChatCalls.init(callAppSetting);// 3. Now both SDKs are ready
// 1. Chat SDK firstawait CometChat.init(appID, appSettings);// 2. Then Calls SDKconst callAppSetting = 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.