> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-v6-beta2-flutter-uikit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Recording (Beta)

> Implement call recording for voice and video calls using the CometChat JavaScript SDK, including start/stop controls, listeners, and accessing recordings from the Dashboard.

<Accordion title="AI Integration Quick Reference">
  ```javascript theme={null}
  // Start recording
  CometChatCalls.startRecording();

  // Stop recording
  CometChatCalls.stopRecording();

  // Listen for recording events (in CallSettings)
  const callListener = new CometChatCalls.OngoingCallListener({
    onRecordingStarted: (event) => console.log("Recording started", event.user),
    onRecordingStopped: () => console.log("Recording stopped"),
  });
  ```

  **Recordings are available on the [CometChat Dashboard](https://app.cometchat.com) → Calls section.**
</Accordion>

Record voice and video calls for playback, compliance, or archival purposes. Recording is built on top of the [Call Session](/sdk/javascript/direct-call) — you add recording listeners to your call settings and optionally control recording programmatically.

## Setup

Add `onRecordingStarted` and `onRecordingStopped` callbacks to your `OngoingCallListener` when building call settings. These fire for all participants when any user starts or stops recording.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    // Add listeners onRecordingStarted and onRecordingStopped to the startCall method
    const defaultLayout = true;
    const audioOnly = false;

    const callListener = new CometChatCalls.OngoingCallListener({
      onRecordingStarted: (event) =>
        console.log("Listener => onRecordingStarted", event.user),
      onRecordingStopped: (event) =>
        console.log("Listener => onRecordingStopped", event.user),
    });

    const callSettings = new CometChatCalls.CallSettingsBuilder()
      .enableDefaultLayout(defaultLayout)
      .setIsAudioOnlyCall(audioOnly)
      .setCallListener(callListener)
      .build();

    const htmlElement = document.getElementById("ELEMENT_ID");
    CometChatCalls.startSession(callToken, callSettings, htmlElement);
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    // Add listeners onRecordingStarted and onRecordingStopped to the startCall method
    const defaultLayout = true;
    const audioOnly = false;

    const callListener = new CometChatCalls.OngoingCallListener({
      onRecordingStarted: (event) =>
        console.log("Listener => onRecordingStarted", event.user),
      onRecordingStopped: () =>
        console.log("Listener => onRecordingStopped"),
    });

    const callSettings = new CometChatCalls.CallSettingsBuilder()
      .enableDefaultLayout(defaultLayout)
      .setIsAudioOnlyCall(audioOnly)
      .setCallListener(callListener)
      .build();

    const htmlElement = document.getElementById("ELEMENT_ID");
    CometChatCalls.startSession(callToken, callSettings, htmlElement);
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    // Add listeners onRecordingStarted and onRecordingStopped to the startCall method
    const defaultLayout = true;
    const audioOnly = false;

    const callListener = new CometChatCalls.OngoingCallListener({
      onRecordingStarted: (event) =>
        console.log("Listener => onRecordingStarted", event.user),
      onRecordingStopped: () =>
        console.log("Listener => onRecordingStopped"),
    });

    const callSettings = new CometChatCalls.CallSettingsBuilder()
      .enableDefaultLayout(defaultLayout)
      .setIsAudioOnlyCall(audioOnly)
      .setCallListener(callListener)
      .build();

    const htmlElement = document.getElementById("ELEMENT_ID");
    CometChatCalls.startSession(callToken, callSettings, htmlElement);
    ```
  </Tab>
</Tabs>

The `onRecordingStarted` callback receives an event object — see the [`OngoingCallListener`](/sdk/javascript/all-real-time-listeners#ongoing-call-listener-calls-sdk) reference for the full shape.

The `onRecordingStopped` callback receives no arguments.

<Warning>
  Always remove listeners when they're no longer needed (e.g., on component unmount or page navigation). Failing to remove listeners can cause memory leaks and duplicate event handling.
</Warning>

## Settings for call recording

## CallSettings Options

| Setting                                                         | Description                                                                                                                                                                          |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `showRecordingButton(showRecordingButton: boolean)`             | If set to `true` it displays the Recording button in the button Layout. if set to `false` it hides the Recording button in the button Layout. **Default value = false**              |
| `startRecordingOnCallStart(startRecordingOnCallStart: boolean)` | If set to `true` call recording will start as soon as the call is started. if set to `false` call recording will not start as soon as the call is started. **Default value = false** |

## Programmatic Control

If you're building a custom UI without the default layout, use these methods to control recording during an active call.

### Start Recording

You can use the startRecording() method to start call recording.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    CometChatCalls.startRecording();
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    CometChatCalls.startRecording();
    ```
  </Tab>
</Tabs>

### Stop Recording

You can use the stopRecording() method to stop call recording.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    CometChatCalls.stopRecording();
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    CometChatCalls.stopRecording();
    ```
  </Tab>
</Tabs>

## Downloading Recordings

Call recordings are available on the [CometChat Dashboard](https://app.cometchat.com) under the Calls section. Click the three-dot menu and select "View Recordings".

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-v6-beta2-flutter-uikit/g3E3THkvQTdQ1Mu8/images/f60b5e59-t4erpygunz9w2oxjn0nyfmez9d38l2ny8qauc33cpkgc9mz1udly2om321yf67wm-5b58e8c9377ee9bac1626a390525d975.png?fit=max&auto=format&n=g3E3THkvQTdQ1Mu8&q=85&s=f887084d5281d5015d423c7c09af46ef" width="3148" height="2400" data-path="images/f60b5e59-t4erpygunz9w2oxjn0nyfmez9d38l2ny8qauc33cpkgc9mz1udly2om321yf67wm-5b58e8c9377ee9bac1626a390525d975.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-v6-beta2-flutter-uikit/l_OnVHhTFtMCxAJj/images/db32f683-wmlk4h4nnpjz3nwabp3yhjil9u38cu9z27gsf0cdpy4x1ozfpuh6e2pv4apsafr4-4eb5d3cce059b21d7a1add99427296dd.png?fit=max&auto=format&n=l_OnVHhTFtMCxAJj&q=85&s=985ca003a6a0e9570197ea41d9614259" width="3148" height="2400" data-path="images/db32f683-wmlk4h4nnpjz3nwabp3yhjil9u38cu9z27gsf0cdpy4x1ozfpuh6e2pv4apsafr4-4eb5d3cce059b21d7a1add99427296dd.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-v6-beta2-flutter-uikit/0L6R89KI7D3gjTkS/images/31402cdd-fi6v16el19pe29q37izzqopz9k9ur8hz94ju2jxsh4avnmh33fcktwceouu7om2h-aad037f6953c6ba50729c8e00da500ef.png?fit=max&auto=format&n=0L6R89KI7D3gjTkS&q=85&s=39f4b600e79255c36a47318164e449d2" width="3148" height="2400" data-path="images/31402cdd-fi6v16el19pe29q37izzqopz9k9ur8hz94ju2jxsh4avnmh33fcktwceouu7om2h-aad037f6953c6ba50729c8e00da500ef.png" />
</Frame>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Default Calling" icon="phone" href="/sdk/javascript/default-call">
    Implement ringing call flows with accept/reject functionality
  </Card>

  <Card title="Call Logs" icon="list" href="/sdk/javascript/call-logs">
    Retrieve and display call history for users and groups
  </Card>
</CardGroup>
