CometChat Calls SDK v5 — Session Settings
Overview
SessionSettings is a plain object that configures every aspect of a call session before joining. Pass it to joinSession() — all properties are optional with sensible defaults.
Key Imports
import { CometChatCalls, type SessionSettings } from '@cometchat/calls-sdk-javascript';
Implementation
Full Settings Example
const sessionSettings: SessionSettings = {
// Session type & layout
sessionType: 'VIDEO', // 'VIDEO' | 'VOICE'
layout: 'TILE', // 'TILE' | 'SIDEBAR' | 'SPOTLIGHT'
// Initial media state
startAudioMuted: false,
startVideoPaused: false,
// Recording
autoStartRecording: false,
// Timeout
idleTimeoutPeriodBeforePrompt: 60000, // ms before showing "extend?" prompt
idleTimeoutPeriodAfterPrompt: 120000, // ms after prompt before auto-end
// Identity
displayName: 'John Doe',
title: 'Team Meeting',
// Hide panels
hideControlPanel: false,
hideHeaderPanel: false,
hideSessionTimer: false,
hideNetworkIndicator: false,
hideRecordingStatusIndicator: false,
// Hide individual buttons
hideLeaveSessionButton: false,
hideToggleAudioButton: false,
hideToggleVideoButton: false,
hideSwitchCameraButton: false,
hideRecordingButton: true, // hidden by default
hideRaiseHandButton: false,
hideShareInviteButton: true, // hidden by default
hideParticipantListButton: false,
hideChangeLayoutButton: false,
hideChatButton: true, // hidden by default
hideScreenSharingButton: false,
// Web-specific
hideVirtualBackgroundButton: false,
enableNoiseReduction: false,
audioInputDeviceId: undefined, // pre-select specific device
audioOutputDeviceId: undefined,
videoInputDeviceId: undefined,
// Spotlight layout options
enableSpotlightDrag: true,
enableSpotlightSwap: true,
// Participant context menu (right-click actions)
enableParticipantContextMenu: true,
};
CometChatCalls.joinSession(token, sessionSettings, container);
Constants Reference
// Access via CometChatCalls.constants
CometChatCalls.constants.LAYOUT.TILE // 'TILE'
CometChatCalls.constants.LAYOUT.SIDEBAR // 'SIDEBAR'
CometChatCalls.constants.LAYOUT.SPOTLIGHT // 'SPOTLIGHT'
CometChatCalls.constants.TYPE.VIDEO // 'VIDEO'
CometChatCalls.constants.TYPE.VOICE // 'VOICE'
Common Presets
Voice call:
const voiceSettings: SessionSettings = {
sessionType: 'VOICE',
layout: 'SPOTLIGHT',
startVideoPaused: true,
};
Video call:
const videoSettings: SessionSettings = {
sessionType: 'VIDEO',
layout: 'TILE',
startVideoPaused: false,
};
Custom UI (hide default controls):
const customSettings: SessionSettings = {
hideControlPanel: true,
hideHeaderPanel: true,
};
Button Defaults
| Button | Default Hidden? |
|---|---|
| Recording | Yes (true) |
| Share Invite | Yes (true) |
| Chat | Yes (true) |
| All others | No (false) |
Gotchas
SessionSettingsis aPartial<>type — all properties are optionalsessionTypeuses'VOICE'not "AUDIO"- Layout values:
'TILE','SIDEBAR','SPOTLIGHT'— all caps - Idle timeout values are in milliseconds (not seconds like Android)
- Recording, share invite, and chat buttons are hidden by default
hideControlPanel: truehides the entire bottom bar — individual hide methods are ignored- These are pre-session configs only; use
CometChatCalls.*static methods for runtime changes - Web-specific options (
enableNoiseReduction,hideVirtualBackgroundButton, device IDs) are not available on mobile SDKs