npm package: @skribby/sdk
Description: Typescript SDK for Skribby Meeting Bot API
Author: Skribby
Latest version: 0.5.1

# Skribby Typescript SDK

> Skribby is an API-first platform for capturing, transcribing, and processing online meetings. Deploy meeting bots into Zoom, Microsoft Teams, and Google Meet to receive real-time or post-call transcription, audio, and structured data.

## Install

```bash
npm install @skribby/sdk
```

## Quick Start

```ts
import { createClient } from '@skribby/sdk';

const client = createClient({
  api_key: 'SKRIBBY_API_KEY',
});

const jpClient = createClient({
  api_key: 'SKRIBBY_API_KEY',
  region: 'jp',
});

const customClient = createClient({
  api_key: 'SKRIBBY_API_KEY',
  base_url: 'https://platform-jp.skribby.io/api/v1',
});

(async () => {
  const bot = await client.createBot({
    bot_name: 'My Meeting Bot',
    meeting_url: 'https://meet.google.com/abc-defg-hij',
    service: 'gmeet',
    transcription_model: 'deepgram/nova-2-realtime',
  });

  // If the chosen transcription model is real-time
  const realtimeClient = bot.getRealtimeClient();

  // When you connect, you'll instantly receive a "connected" event that contains
  // all transcripts generated up to the point of connection.
  realtimeClient.on('connected', (data) => {
    console.log(`Initial transcripts received: ${data.transcripts.length}`);
  });

  realtimeClient.on('ts', (data) => {
    console.log(`${data.speaker_name} said: ${data.transcript}`);

    // You can fetch the full transcription at any time:
    // (Note: returns an array of transcript segments)
    const fullTranscriptSoFar = realtimeClient.transcript;

    if (data.transcript.toLowerCase().includes('hello')) {
      realtimeClient.send('chat-message', {
        content: 'Hello back! :)',
      });
    }
    if (data.transcript.toLowerCase().includes('stop the bot')) {
      realtimeClient.send('stop');
    }
  });

  realtimeClient.connect();
})();
```

## Bot Operations

### Create a Bot

```ts
const bot = await client.createBot({
  bot_name: 'My Meeting Bot',
  meeting_url: 'https://meet.google.com/abc-defg-hij',
  service: 'gmeet',
  transcription_model: 'openai/whisper-large-v3',
  webhook_url: 'https://your-server.com/webhook', // Optional: receive status updates
});
```

### Get a Bot by ID

```ts
const bot = await client.getBotById('bot_123');
```

### Get Bot Pricing

```ts
const pricing = await client.getBotPricing('bot_123');

console.log(pricing.currency); // USD
console.log(pricing.total.rate_per_hour); // e.g. 0.92
console.log(pricing.total.amount); // null while in progress, number when finished

// If you already have a MeetingBot instance:
const bot = await client.getBotById('bot_123');
if (bot) {
  const pricingFromBot = await bot.getPricing();
  console.log(pricingFromBot.total.amount);
}
```

### Get All Scheduled Bots

```ts
const scheduledBots = await client.getScheduledBots();
```

### Update a Scheduled Bot

```ts
// Update via client
await client.updateBot('bot_123', {
  bot_name: 'Updated Bot Name',
  meeting_url: 'https://meet.google.com/new-meeting-url',
});

// Or update via bot instance
await bot.update({
  bot_name: 'Updated Bot Name',
});
```

### Stop a Bot

```ts
await bot.stop();
```

### Delete a Bot

```ts
await bot.delete();
```

### Send a Chat Message

```ts
await bot.sendChatMessage('Hello from the bot!');
```

## Recording Operations

Upload and transcribe recordings independently of meeting bots.

### Create a Recording from URL

```ts
const recording = await client.createRecording({
  recording_url: 'https://example.com/meeting-recording.mp4',
  transcription_model: 'openai/whisper-large-v3',
  lang: 'en',
  webhook_url: 'https://your-server.com/webhook', // Optional
});
```

### Re-transcribe from a Meeting Bot

```ts
const recording = await client.createRecording({
  meeting_bot_id: 'bot_123',
  transcription_model: 'deepgram/nova-2', // Override the original model
});
```

### Get a Recording by ID

```ts
const recording = await client.getRecordingById('rec_123');
console.log(recording.data.transcript);
```

### Refresh Recording Data

```ts
await recording.refresh();
console.log(recording.data.status); // Check updated status
```

### Delete a Recording

```ts
await recording.delete();
```

## Real-time Transcription

For bots using real-time transcription models (e.g., `deepgram/nova-2-realtime`, `assemblyai/universal-streaming`):

```ts
const realtimeClient = bot.getRealtimeClient();

// Listen for transcription events
realtimeClient.on('ts', (data) => {
  console.log(`${data.speaker_name}: ${data.transcript}`);
});

// When you connect, you'll instantly receive a "connected" event that contains
// all transcripts generated up to the point of connection.
realtimeClient.on('connected', (data) => {
  console.log(`Initial transcripts received: ${data.transcripts.length}`);
});

// Listen for chat messages
realtimeClient.on('chat-message', (data) => {
  console.log(`Chat from ${data.username}: ${data.content}`);
});

// Listen for participant events
realtimeClient.on('participant-tracked', (data) => {
  console.log(`Participant joined: ${data.participantName}`);
});

// Listen for status updates
realtimeClient.on('status-update', (data) => {
  console.log(`Bot status changed: ${data.old_status} -> ${data.new_status}`);
});

// Send actions
realtimeClient.send('chat-message', { content: 'Hello!' });
realtimeClient.send('stop'); // Stop the bot

// You can fetch the full transcription at any time:
// (Note: returns an array of transcript segments)
console.log('Full transcript so far:', realtimeClient.transcript);

await realtimeClient.connect();
```

## Webhooks

When you provide a `webhook_url`, Skribby will POST events to your server:

```json
{
  "type": "status_update",
  "data": {
    "old_status": "joining",
    "new_status": "recording"
  }
}
```

## Documentation

Refer to the [Skribby documentation page](https://docs.skribby.io/) for more details.