Desktop Recording SDK Overview

Integrate the Desktop Recording SDK to detect and record meetings and retrieve recordings and transcripts in your Electron app without adding a standard recording bot tile to the call.


The Desktop Recording SDK allows an Electron application to record Zoom, Microsoft Teams, and Google Meet calls on Windows and Apple Silicon Macs without adding a standard recording bot tile to the call.

On supported macOS meeting platforms, the SDK can use Desktop SDK Raw Media when it has been enabled for your workspace. Otherwise, the SDK records locally.

Curious about our platform support or supported languages? See our platform support matrices.

Desktop Recording SDK Lifecycle

  1. On meeting-detected, add the window to your app’s meeting picker. A meeting URL is optional.
  2. When the user chooses Record, check the permissions for the selected capture mode. Reserve one recording attempt for the selected window before making any asynchronous calls.
  3. Ask your authenticated backend to create a Desktop SDK Upload. Keep the workspace API key on the backend. Store the upload ID with the attempt and return the upload token to Electron main.
  4. Check that the same window and attempt are still current, then call startRecording once. Show the recording indicator when recording-started arrives.
  5. After capture ends, track the upload independently. Your backend receives sdk_upload.complete when the upload finishes. Use its recording ID to retrieve media or request asynchronous transcription.

Now that you understand the DSDK recording lifecycle, you should also familiarize yourself with when the DSDK will capture video successfully.

Quickstart

Run the Electron sample app to detect a meeting, choose a window, record, and follow the upload. Start in electron/dsdk/ for the reusable recorder. The sample’s electron/controller.ts shows where to attach your own application behavior.

Installation

Once you've explored the sample app and are ready to integrate the Desktop Recording SDK into to your own app, install the SDK:

# Stable channel
npm install @recallai/desktop-sdk

# Nightly channel (bleeding edge, but potentially less stable)
npm install @recallai/desktop-sdk@nightly
📘

Installing with Bun

If you're using Bun, you'll need to add the Desktop Recording SDK to Bun's trustedDependencies list for it to install properly. Add this to your package.json:

{
  ...,
  "trustedDependencies": ["@recallai/desktop-sdk"]
}
📘

Installing with npm 12+ or pnpm

npm 12 and later, and pnpm, don't run a dependency's install script unless your project allows it. The Desktop SDK's install script (setup.js) downloads the SDK's native binaries. If the script is blocked, the install still finishes with only a warning, and your app logs Desktop SDK: Couldn't launch! when it starts.

npm 12+: add the SDK to allowScripts in your project's package.json and commit the change:

{
  ...,
  "allowScripts": {
    "@recallai/desktop-sdk": true
  }
}

Or run npm approve-scripts --no-allow-scripts-pin @recallai/desktop-sdk, which writes the same entry. If the SDK was already installed before you allowed it, run npm rebuild @recallai/desktop-sdk to download the binaries.

Use the package name without a version. By default, npm approve-scripts writes a versioned entry like "@recallai/[email protected]": true. That entry stops applying when you upgrade the SDK, so the upgraded SDK installs without its binaries.

pnpm: run pnpm approve-builds @recallai/desktop-sdk. It adds the SDK to allowBuilds in pnpm-workspace.yaml and downloads the binaries.

allowBuilds:
  '@recallai/desktop-sdk': true

Usage

Starting the SDK

To get started, you'll need to initialize the Desktop Recording SDK. This should be called once at startup.

const RecallAiSdk = require('@recallai/desktop-sdk');

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

You must set the following parameter when initializing the SDK:

apiUrl: The URL corresponding to the region your Recall.ai workspace belongs to. See the table below for the correct mapping of region to base URL:

Requesting system permissions (MacOS)

The Desktop Recording SDK does not require any additional permissions to work on windows machines. On MacOS, you will need to request specific system permissions from the user before you're able to detect and record meetings. At minimum, you should request the microphone, accessibility, and screen-capture permissions. You can find a full list of supported permissions here.

const RecallAiSdk = require('@recallai/desktop-sdk');

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

RecallAiSdk.requestPermission("accessibility");
RecallAiSdk.requestPermission("microphone");
RecallAiSdk.requestPermission("screen-capture");

For macOS audio-only capture, use accessibility, microphone, and system audio. Check the current permission state after the user returns from Settings. Show which permission still needs attention. For packaged apps, check the required Info.plist entries in the audio-only guide. Prepare Raw Media before the meeting and inspect recording-started.rawMedia to display the mode actually in use.

Adding Event Listeners

The SDK monitors for a variety of different events that you'll be able to subscribe to in your application.

Use meeting-detected to update the meeting picker. When your app decides to record, reserve the attempt, request an upload token, and check that the selected window is still available before calling startRecording. On macOS, subscribe to permission events so the picker can show whether recording is available. See Desktop Recording SDK Event Types.

RecallAiSdk.addEventListener("permissions-granted", async (evt) => {
  // The user has granted all the required permsisions to start recording
});

RecallAiSdk.addEventListener("meeting-detected", async (evt) => {
  const { window } = evt;
});

Recording a Meeting

To actually start recording a meeting, you'll need to call the Create Desktop SDK Upload endpoint. The Desktop Recording SDK can capture many different kinds of data including video, audio, participant data, and more. When calling the Create Desktop SDK Upload endpoint, you'll be able to configure which data to capture and specify what data to receive in real time.

Custom Recording Configurations

Minimal Request (Defaults)

By default, the SDK will record video of the meeting and capture participant events (e.g., when a participant joins or leaves the call) without any additional configuration required.

const url = 'https://us-west-2.recall.ai/api/v1/sdk_upload/';
const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    Authorization: 'YOUR_API_KEY'
  }
};

fetch(url, options)

Response

{
   "id": "4abf29fc-36b5-4853-9f84-a9990b9e354b",
   "upload_token": "FEv5Ri9MdKmFwbEMSiHbobHcHBotEFBE"
}

You'll receive an upload_token in the response from this endpoint. You will pass this token to the RecallAiSdk.startRecording() function in your desktop application to initiate a recording. You can read more about the available SDK methods here.

Call the following from your Record action after reserving the attempt. Here, backend is your authenticated application client and isCurrent checks that the user still wants to record this live window.

async function startAttempt(attempt, backend, isCurrent) {
  const res = await backend.createUpload(attempt.id);
  if (!res.ok) throw new Error(`Create upload returned ${res.status}`);
  const payload = await res.json();
  attempt.uploadId = payload.id;
  if (!isCurrent(attempt)) return;
  await RecallAiSdk.startRecording({
    windowId: attempt.windowId,
    uploadToken: payload.upload_token
  });
}
📘

What is a window id?

The windowId tells the SDK which window or audio source to record when you call startRecording():

  • For meeting platforms (Zoom, Teams, Google Meet, etc.), a windowId identifies a specific meeting window (e.g. Zoom app meeting window, Google Meets tab in chrome, etc.) on your desktop, provided by the SDK via the meeting-detected event
  • For adhoc/in-person meetings, a windowId is generated by calling prepareDesktopAudioRecording() and represents the system's audio streams rather than a visual window

Receiving Real-Time Events

The Desktop Recording SDK allows you to access meeting data as the meeting happens: transcripts, participant activities, raw audio, and video frames can all be delivered live through the SDK's event listener.

To receive real-time events, you need to:

  1. Configure which events you want to receive when creating the SDK upload by configuring recording_config.realtime_endpoints in your Create Desktop SDK Upload request
  2. Listen for events in your desktop app using the realtime-event listener (see this section for more info)

The events you specify in step 1 will determine what data flows to your application during the recording. Below are the events that you can listen for:

EventDescriptionPayload
participant_events.joinA participant joined.Schema
participant_events.updateA participant updated their details.Schema
participant_events.speech_onA participant started speaking.Schema
participant_events.speech_offA participant stopped speaking.Schema
participant_events.screenshare_onA participant started screen sharing.Schema
participant_events.screenshare_offA participant stopped screen sharing.Schema
transcript.dataA transcript utterance was generated (see Real-time Transcription.Schema
transcript.partial_dataA partial transcript utterance was generated (see Real-time Transcription.Schema
transcript.provider_dataTranscript data was generated in the raw format from the transcription provider. (see Real-time Transcription .
video_separate_png.dataA separate video buffer was generated from the call.Schema
audio_mixed_raw.dataA mixed audio buffer was generated from the call.Schema

Why did two people produce four participant IDs?

A participant event can represent an audio source. For example, a two-person call can produce two person entries and two audio-source entries. If you pass the number of distinct IDs to a diarization service as its expected speaker count, it may split two voices across four labels. Keep source IDs for correlating speech events. Count only entries you can identify as people for the roster, and leave the expected speaker count unset when you cannot establish it.

Example: Real-Time Transcription

One of the most common uses for real-time events is receiving live transcripts during the meeting. To enable this, you need to configure both a transcript provider and the transcript events you want to receive.
Below is an example of how to set up real-time transcription with AssemblyAI. Check out this guide on real-time transcription with the Desktop Recording SDK for a full walkthrough.

const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    Authorization: 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    recording_config: {
      transcript: {
        provider: {
          assembly_ai_v3_streaming: {
             // include any supported parameters for Assembly's real-time models
             // https://www.assemblyai.com/docs/api-reference/streaming-api/streaming-api
          }
        }
      },
      realtime_endpoints: [
        {
          type: 'desktop_sdk_callback',
          events: ['participant_events.join',       // know who's in the meeting
                   'transcript.data'                // receive transcript in real time
                  ]
        }
      ]
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));

Example: Real-Time Audio

If you're interested in using your own model to transcribe the conversation, you'll want to subscribe to the raw audio stream of the meeting.
Below is an example request demonstrating how to subscribe to stream raw audio from the meeting in real time:

const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    Authorization: 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    recording_config: {
      realtime_endpoints: [
        {
          type:   'desktop_sdk_callback',
          events: ['audio_mixed_raw.data',          // receive raw audio data
                   'participant_events.speech_on',  // track who's speaking
                   'participant_events.speech_off',
                   'participant_events.update'
                  ]
        }
      ]
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));

The audio will be returned as a base64 encoded, mono channel of 16K samples of S16LE.

Managing windows and recording attempts

Keep one set of SDK listeners in Electron main. The renderer can display the available windows and send Record or Stop actions to main. Remove listeners when their owner is disposed so reopening the UI cannot register a second handler.

Event or actionApplication behavior
Meeting detected or updatedAdd detected windows by SDK window ID. Apply metadata updates only to windows you still track. Use a URL for display when available.
Window closesRemove it immediately and invalidate pending Start work. Let the SDK handle natural closure. Keep the recording attempt and upload ID available for later events.
Record clicked twiceReserve the attempt before requesting a token. Ignore additional starts while the first outcome is pending or capture is active.
User stops and the meeting reappearsSend Stop once. A newly detected window can be offered in the picker. Require a fresh recording decision.
SDK process exitsDiscard window handles from that process. After reinitializing, use newly detected handles. Retain upload IDs for recovery.
Network request times outRetry transient upload-status reads with bounded backoff. If create or Start timed out, reconcile the existing attempt before issuing another command.

For the complete implementation, see the sample recorder.

🚧

Before shipping, read SDK Safe Shutdown and Recovery to avoid losing media when your app quits or the network drops.

SDK Upload Webhooks

You can choose to receive webhooks notifying you about the status of recordings produced with the Desktop Recording SDK. You can listen to these to decide when to download the video recording from Recall or kick off an async transcription job. You can subscribe to these webhooks from the Recall transcription dashboard.

Below are the webhooks that you're currently able to subscribe to:

EventDescription
sdk_upload.completeSDK Upload has finished successfully
sdk_upload.failedSDK Upload has finished unsuccessfully
sdk_upload.uploadingSDK upload has started uploading to the Recall.ai platform

You can read more about these webhooks in this section of the docs.

Retrieving the recording & transcript after the upload completes

After receiving the sdk_upload.complete webhook you can retrieve the recorded video (and transcript, if real time transcription was configured) file using the Retrieve Recording endpoint with the recording_id field from the webhook:

Endpoint

curl --request GET \
     --url https://us-east-1.recall.ai/api/v1/recording/71f4d556-4c8c-4627-a253-61344e8f22f7 \
     --header 'Authorization: Token your-recall-api-token' \
     --header 'content-type: application/json' 

Response

{
  "id": "71f4d556-4c8c-4627-a253-61344e8f22f7",
  "media_shortcuts": {
    "video_mixed": {
      "status": {
        "code": "done"
      },
      "data": {
        "download_url": "https://some-download-endpoint",
      }
    },
    "transcript": {
      "status": {
        "code": "done"
      },
      "data": {
        "download_url": "https://some-download-endpoint",
      }
    }
  }
}

The recording is ready but the transcript failed

Track the recording and transcript separately. For example, your backend may receive sdk_upload.complete for an upload and transcript.failed for a transcript associated with its recording. Keep playback available. Show Recording ready · Transcription failed, and retain the transcript ID and failure subcode for investigation. Handle transcript.failed in your webhook handler alongside the success event.

To test this path, replay a completed upload event and a failed transcript event for the same recording using the recording webhook payloads. Verify that the handler accepts the failure event, preserves the diagnostic details, and clears the pending transcript indicator.

A completed upload no longer has a recording

Look up the upload by ID and check the recording ID from the original completion event. If the recording was present then and is missing now, inspect your backend’s export, retention, and Delete Recording logs for that ID. If you delete recordings after export, verify that the required files are readable at their destination before deleting the source. Log the recording ID, caller, and reason when you delete it.

Note when building for production

🚧

By default, Electron Forge's code signing tool, osx-sign, has issues signing the Desktop SDK. Recall.ai provides a fork of osx-sign you can use to correctly sign the package when you're building your application for release. If you don't want to worry about configuring this, try our sample project with this already configured!

Next steps

Now that you have a sense of how to work with the Desktop Recording SDK, here are a few things to try next:

This will allow your app to transcribe conversations in real-time, allowing you to react to conversation data as soon as it's spoken.

This will allow you to transcribe conversations after they've ended. Async transcription tends to be more accurate than real-time transcription, so choose this option if you don't need the data in real time.

You can also record meetings that take place outside of meeting platforms using the Desktop Recording SDK! Learn how to add this functionality to your app.



Did this page help you?