Creates a new Skribby Client.
| Parameter | Default | Description |
|---|---|---|
options | required | Options when creating a new client |
options.api_key | required | Skribby API Key found on the platform |
import { SkribbyClient } from "@skribby/sdk";
const client = new SkribbyClient({
api_key: "SKRIBBY_API_KEY",
});All methods (except getRealtimeClient) interact with Skribby's server.
Refer to the SkribbyClient API Requests Throws section for more information on error handling.
Create a new Meeting Bot which will join the meeting right away.
This method expects an object of options which is identical to the ones in the REST API Documentation. Please refer to the Create Bot Endpoint for all options.
await client.createBot({
bot_name: "My Meeting Bot",
meeting_url: "https://meet.google.com/abc-defg-hij",
service: "gmeet",
transcription_model: "whisper",
});Schedule a Meeting Bot for later to join.
This method expects an object of options which is identical to the ones in the REST API Documentation. Please refer to the Create Bot Endpoint for all options. Additionally, scheduled_for is required for this method.
| Parameter | Default | Description |
|---|---|---|
options | required | All options from createBot |
options.scheduled_for | required | The scheduled time for the bot to join |
await client.scheduleBot({
bot_name: "My Meeting Bot",
meeting_url: "https://meet.google.com/abc-defg-hij",
service: "gmeet",
transcription_model: "whisper",
scheduled_for: new Date(new Date().getTime() + 5 * 60000); // Join in 5 minutes
});Update an existing Meeting Bot.
| Parameter | Default | Description |
|---|---|---|
botId | required | ID of the meeting bot to update |
options | required | Update options |
This method expects an object of options which is identical to the ones in the REST API Documentation. Please refer to the Update Bot Endpoint for all options.
await client.updateBot("123456", {
bot_name: "Updated Bot Name",
scheduled_start_time: new Date(new Date().getTime() + 10 * 60000),
});Fetch all scheduled bots.
await client.getScheduledBots();Fetch a bot with a specific ID.
| Parameter | Default | Description |
|---|---|---|
botId | required | ID of the meeting bot |
await client.getBotById("123456");Create a new Recording.
This method expects an object of options which is identical to the ones in the REST API Documentation. Please refer to the Create Recording Endpoint for all options.
await client.createRecording({
// recording options
});Fetch a recording with a specific ID.
| Parameter | Default | Description |
|---|---|---|
recordingId | required | ID of the recording |
await client.getRecordingById("123456");All API requests from this package happens through this method.
This is made available in case new functionalities are provided on the REST API but not made available in the SDK yet.
| Parameter | Default | Description |
|---|---|---|
| endpoint | required | Just the endpoint you're trying to each (eg. /bot for creating a new bot) |
| method | GET | Method to be used for the API Call |
| body | {} | Body contents to be used for the API Call |
If an API call has failed, then we'll throw an error depending on status code.
Below is a list of predefined custom errors to make handling them easier:
UnauthorizedError(401) - Provided API Key is invalidNotFoundError(404) - Requested entity not foundUnprocessableEntityError(422) - Validation has failed (eg. required parameters were not provided)ApiRequestError- Global catch for other uncommon errors
The first 3 errors extend the ApiRequestError. So if you want a global catch you can simply use the ApiRequestError. All errors will include the following properties:
statusstatusTextresponseBodyurlmethod
Object data returned from the endpoint.