How to download cloud recording when ended

Hi! Is it possible to get the link to a cloud recording once it has finished uploading and has been recorded? I am using Daily Prebuilt + JS

Tagged:

Best Answer

  • daily_joey
    daily_joey Moderator, Dailynista admin
    Answer ✓

    @reeceatkinson Recording links are generated via the REST API, using the /access-link endpoint:

    This requires passing in the recording_id parameter, which is available as recordingId from the recording-started event:

    So, when a recording is started, you can save the recordingId for use when retrieving the recording later. Once the recording-stopped event fires, you can initiate a request from the local client to a server-side function on your backend, to make a secure REST API request on the user's behalf to Daily's REST API, which will eventually return a download link.

    Since generating the access link requires authenticating the request using the Daily API Key, you should avoid making this request from the local client to avoid exposing your API key. So, doing this will require some code on the local client and additional code running on a backend server for security purposes.

Answers

  • daily_joey
    daily_joey Moderator, Dailynista admin

    Hi @reeceatkinson ,

    Are you looking to generate an access link automatically once a recording is stopped? Do you need it during the session, or afterwards?

    We're still working on adding recording-specific webhooks , but we do have a webhook for the end of a meeting session. Using this, you can search for recordings from recently finished sessions in order to generate access links.

    For assistance with setting up the webhook_meeting_end on a domain, please write in to help@daily.co.

  • @daily_joey we need the recording once it is stopped and then we can give the link to the user

  • daily_joey
    daily_joey Moderator, Dailynista admin

    @reeceatkinson In this case, you should be able to listen the recording-stopped event to trigger a server-side function that generates a recording access link to return to the user.

    In the future, we're planning to also have a "recording-finished" webhook which can be used in a similar way, allowing you to generate an access link without needing to listen for a client-side event.

  • @daily_joey right now we use recording-stopped but how would we go about accessing the cloud recording link for that session?

    callFrame.on('recording-stopped', recordingEnded)

    function recordingEnded() { // some code }