Skip to content
Last updated

[C] Recording

constructor

Creates a recording instance to interact with this recording. You normally wouldn't need to instantiate this class manually. When creating or fetching recordings via the SkribbyClient, an instance of this class will be returned.

ParameterDefaultDescription
clientrequiredA SkribbyClient instance
api_datarequiredObject containing API Data of a recording (Refer to Get Recording Endpoint)
import { Recording } from "@skribby/sdk";

const recording = new Recording(client, {
  id: "3c09b2aa-6708-42c1-8145-aa55ee223613",
  status: "completed",
  recording_url: "http://example.com",
  recording_available_until: "2019-08-24T14:15:22Z",
  events: [
    {
      event: "status_update",
      data: {
        old_status: "processing",
        new_status: "completed",
      },
      created_at: "2019-08-24T14:15:22Z",
    },
  ],
  created_at: "2019-08-24T14:15:22Z",
});

Properties

id

Simply returns the recording ID.

Returns

string

Example

console.log(recording.id);

data

Returns the data available on this recording.
Returned data is identical to returned data from Get Recording Endpoint with the only exception that dates have been parsed to Date objects already.

Returns

RecordingData (object)

Example

console.log(recording.data.status);
console.log(recording.data.recording_url);
console.log(recording.data.recording_available_until);
// ...

Methods

Error Handling

All methods interact with Skribby's server.
Refer to the SkribbyClient API Requests Throws section for more information on error handling.

refresh

Fetch the latest data from the server.

Returns

void

Example

await recording.refresh();
console.log(recording.data.status); // Contains latest data from server now

delete

Delete all data related to the recording.
Be aware, this action is not reversible!

Returns

void

Example

await recording.delete();