# useRecording Observe recording capture and finalization through application callbacks. `useRecording(options)` is independent of RelayProvider and RelayRoom. Supply stable callbacks to authenticated application endpoints. Keep management keys on the backend. ## Options | Option | Contract | | --- | --- | | `getRecording` | Required; receives AbortSignal and returns RecordingResource or null. | | `start`, `stop`, `delete` | Optional application commands receiving `{ signal, idempotencyKey }`. | | `pollIntervalMs` | Integer 1000–60000 milliseconds; default 2500. | Forward command keys to your backend SDK calls. Callbacks must honor AbortSignal. isRecording is true only for observed recording state; isProcessing indicates finalizing. RecordingIndicator displays state and does not obtain consent. getRecording identity selects the resource; command closures can update without resetting its observed state. Obtain consent before enabling a start action. ## Returns The hook returns recording, pending, error, isRecording, isProcessing, start, stop, delete and refresh. `pending` covers the application request, not completion of asynchronous server work. Errors are sanitized in the snapshot. ## Example The parent supplies memoized options bound to one selected resource. ```tsx import { useRecording, RecordingIndicator } from '@relayrtc/react' export function RecordingPanel({ options, consent }: { options: Parameters[0]; consent: boolean }) { const capture = useRecording(options) return
{capture.error &&

{capture.error.message}

}
} ``` ## Lifecycle and retries Unmounting stops polling and aborts outstanding callbacks. Status revisions prevent stale polling from overwriting a newer command result. An uncertain command retains its idempotency key; retry the same action/payload rather than reusing it for another resource. HTTP cancellation does not undo committed server work. See the [workflow](/guides/recording-and-vod) for backend setup, retention and authorization. The browser SDK exposes the corresponding client without React.