Skip to content
Last updated

[C] SkribbyClient

constructor

Creates a new Skribby Client.

ParameterDefaultDescription
optionsrequiredOptions when creating a new client
options.api_keyrequiredSkribby API Key found on the platform
import { SkribbyClient } from '@skribby/sdk'

const client = new SkribbyClient({
  api_key: 'SKRIBBY_API_KEY'
});

Methods

Error Handling

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

createBot

Create a new Meeting Bot which will join the meeting right away.

Parameters

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.

Returns

MeetingBot

Example

await client.createBot({
  bot_name: 'My Meeting Bot',
  meeting_url: 'https://meet.google.com/abc-defg-hij',
  service: 'gmeet',
  transcription_model: 'whisper',
});

scheduleBot

Schedule a Meeting Bot for later to join.

Parameters

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. scheduled_start_time is required for this method.

Returns

MeetingBot

Example

await client.createBot({
  bot_name: 'My Meeting Bot',
  meeting_url: 'https://meet.google.com/abc-defg-hij',
  service: 'gmeet',
  transcription_model: 'whisper',
  scheduled_start_time: new Date(new Date().getTime() + 5 * 60000); // Join in 5 minutes
});

getScheduledBots

Fetch all scheduled bots.

Returns

MeetingBot[]

Example

await client.getScheduledBots()

getBotById

Fetch a bot with a specific ID.

Parameters

ParameterDefaultDescription
idrequiredID of the meeting bot

Returns

MeetingBot

Example

await client.getBotById('123456')

apiRequest

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.

Parameters

ParameterDefaultDescription
endpointrequiredJust the endpoint you're trying to each (eg. /bot for creating a new bot)
methodGETMethod to be used for the API Call
body{}Body contents to be used for the API Call

Throws

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 (422) - Provided API Key is invalid
  • NotFoundError (404) - Requested entity not found
  • UnprocessableEntityError (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:

  • status
  • statusText
  • responseBody
  • url
  • method

Returns

Object data returned from the endpoint.