Skip to main content
Paid plans only useRecordingInstances(): RecordingInstanceState[] This is useful when working with multi-instance recording to enumerate and display all active (and recently stopped) recording instances.

Return value

An array of RecordingInstanceState objects, each with the following properties:
error
boolean
true if this instance encountered a recording error.
errorMsg
string
Error message for this instance, if any.
instanceId
string
The unique identifier for this recording instance.
isLocalParticipantRecorded
boolean
Whether the local participant is recorded by this instance.
isRecording
boolean
Whether this instance is currently recording.
layout
Object
The recording layout configuration for this instance.
local
boolean
true if this is a local recording.
recordingId
string
The recording ID for this instance.
recordingStartedDate
Date
When this instance started recording.
startedBy
string
The session ID of the participant who started this recording.
type
string
The recording type (e.g., 'cloud', 'local').

Example

import { useRecordingInstances } from '@daily-co/daily-react';

export const RecordingInstancesList = () => {
  const instances = useRecordingInstances();

  if (instances.length === 0) {
    return <div>No recordings</div>;
  }

  return (
    <ul>
      {instances.map((instance) => (
        <li key={instance.instanceId}>
          {instance.instanceId}:{' '}
          {instance.isRecording ? 'Recording' : 'Stopped'}
          {instance.layout?.preset && ` (${instance.layout.preset})`}
        </li>
      ))}
    </ul>
  );
};

See also