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.
| Parameter | Default | Description |
|---|---|---|
client | required | A SkribbyClient instance |
api_data | required | Object 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",
});Simply returns the recording ID.
string
console.log(recording.id);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.
RecordingData (object)
console.log(recording.data.status);
console.log(recording.data.recording_url);
console.log(recording.data.recording_available_until);
// ...Error Handling
All methods interact with Skribby's server.
Refer to the SkribbyClient API Requests Throws section for more information on error handling.
Fetch the latest data from the server.
void
await recording.refresh();
console.log(recording.data.status); // Contains latest data from server nowDelete all data related to the recording.
Be aware, this action is not reversible!
void
await recording.delete();