Desktop Recording SDK Methods

Use the Desktop Recording SDK methods to initialize the SDK, manage permissions, and control recording sessions from your app.

The Desktop Recording SDK provides methods to control recording sessions and manage permissions. Below is a list of the currently-available SDK methods and their definitions:


init({apiUrl})

RecallAiSdk.init({
  apiUrl: "https://us-west-2.recall.ai",
});

Initializes the SDK. You'll need to pass this parameter on startup:

apiUrl: The URL corresponding to the region your Recall.ai workspace belongs to:

requestPermission(permission)

let permission = ...;
RecallAiSdk.requestPermission(permission);

You can manually request a permission using requestPermission. This will cause a dialog box to be presented to the user if the permission hasn't been requested before. If it has been declined before, nothing will happen. You can pass in one of the permissions defined here.

startRecording({windowId, uploadToken})

RecallAiSdk.startRecording({
  windowId: ...,
  uploadToken: ...
});

Begin recording. This function is usually called inside an event listener for meeting-detected. windowId is provided by the meeting-detected callback, and uploadToken is acquired by creating an SDK Upload on your backend.

See Real-Time Event Payloads for more details on the schema of the data.

stopRecording({windowId})

RecallAiSdk.stopRecording({
  windowId: ...,
});

Stop recording. This function can be called to end a recording before the meeting itself has naturally ended.

pauseRecording({windowId})

RecallAiSdk.pauseRecording({
  windowId: ...,
});

Pause recording. This will make cause the resulting video or audio to be blank for the duration of the paused period.

resumeRecording({windowId})

RecallAiSdk.resumeRecording({
  windowId: ...,
});

Resume recording.

prepareDesktopAudioRecording()

import RecallAiSdk from '@recallai/desktop-sdk';

const res = await Backend.fetch(`/api/create_sdk_recording`, AppState.client_token);
const payload = await res.json();
const windowId = await RecallAiSdk.prepareDesktopAudioRecording();

await RecallAiSdk.startRecording({
  windowId,
  uploadToken: res.upload_token
});

In addition to recording video-platform meetings, the Desktop Recording SDK can also record whole-desktop audio. This can be used to implement, for example, realtime note-takers for in person meetings or for platforms not yet supported by the Desktop Recording SDK.

On Windows, see Windows audio device selection for automatic selection, explicit devices, and system-default mode. The device APIs below apply only to sources created with this method; they do not change detected meeting recordings.

listDevices()

Windows only. Lists the audio input and output devices available for whole-desktop recordings.

const devices = await RecallAiSdk.listDevices();
const outputs = devices.filter(device => device.direction === "output");

Each device has an id, a human-readable name, and a direction of "input" or "output". Use the ID returned on the user's machine with setDesktopAudioDevice. This list does not identify the system default or the device currently being captured. The SDK does not expose a public current-capture-device getter.

setDesktopAudioDevice(id, direction)

Windows only. Selects a device for whole-desktop recordings. Pass an ID from listDevices() and a direction of "input" or "output".

// selectedOutputId is an output ID returned by listDevices() on this machine.
await RecallAiSdk.setDesktopAudioDevice(selectedOutputId, "output");
const windowId = await RecallAiSdk.prepareDesktopAudioRecording();

A selection applies to subsequent whole-desktop recordings in the same running SDK process. Reapply it after restarting the SDK, or when the intended device changes. Input and output selections are independent.

You can also change the selected device while a whole-desktop recording is running on Windows. The change is applied asynchronously; the method resolving does not confirm that audio capture has successfully reopened on the device.

Pass null to clear an explicit selection for one direction:

await RecallAiSdk.setDesktopAudioDevice(null, "output");

Clearing the selection restores the prepared source's automatic or system-default mode for that direction. Selecting a device in Zoom or another meeting app does not call this method or automatically pin SDK capture to that device.

shutdown()

RecallAiSdk.shutdown();

Shuts down the SDK. To use it again, you must call init() again. Calling shutdown() while a local recording is in progress, or while uploads are still draining, can lose media. Raw Media recordings are not affected. See SDK Safe Shutdown and Recovery.



Did this page help you?