Repository navigation
Add support for videoRecordingStartMode - #193
Merged
Merged
Conversation
mhar-vapi
approved these changes
Oct 29, 2026
mhar-vapi
left a comment
There was a problem hiding this comment.
looks good to me overall. please address the p2 timing gap below so a recording failure during join reaches the caller. ci is green, including all 86 tests and the sdk and example builds. the backend rollout and generated-type cleanup listed in the draft still need to happen before release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
videoRecordingStartModeoption tovapi.start()so callers can choose who starts the video recording whenartifactPlan.videoRecordingEnabledis on:client(the server's default): the Daily meeting token starts the cloud recording from the client when the user joins. This is today's behavior.server: Vapi starts the recording from its servers once the user has joined, so a weak client connection can't stop it from starting.Tracks VAPICS-1747.
Changes
New
StartCallOptions.videoRecordingStartMode('client'|'server'), sent in the create-web-call body. When it isn't set it staysundefined, so older backends use the old client behavior instead of returning 400.Reads
transport.videoRecordingStartModefrom the web call in bothstart()andreconnect(). In server mode thevideo-recording-setupprogress event reportsaction: 'started-by-server'instead of'auto-started-via-meeting-token'.Server-side start failures are reported as
recording-error. Avideo-recording.start-failedDaily app message is turned into arecording-errorevent (Vapi couldn't start the recording (<outcome>): <error>) so clients can continue to watch the existing event.The SDK no longer starts recordings itself.⚠️ Before this change, if recording was enabled but the server sent no callToken, the SDK called
startRecording()from the client. Now it starts nothing:video-recording-setupreportsstatus: 'failed'withaction: 'no-meeting-token'.recording-erroris emitted afterstart()/reconnect()resolves. It fires in a later task, so listeners added right after the await still get it, and it is skipped if the call was stopped or replaced in the meantime.type: 'video-recording-setup-error'is no longer emitted.startRecording()themselves if desired.In practice, the manual start is equivalent to the token start since they are both initiated by the client immediately after joining. The token has always been present in production, so the manual start provides no value.
README: the Recording section now explains the two modes.
Example app: adds a "Recording Start Mode" selector (default / client / server), logs
recording-startedandrecording-error, and shows thecall-start-progressaction.Before merging (why this is a draft)
There are two
TODO(VAPICS-1747)comments invapi.tsto resolve once the backend change is deployed andapi.tsis regenerated from the prod spec:VideoRecordingStartModetype alias withCreateWebCallDTO['videoRecordingStartMode']CreateWebCallDTO & { videoRecordingStartMode?: ... }intersection oncreateWebCallBodyand use plainCreateWebCallDTO