TypeScript SDKUpdated 1 month ago
Examples
Quick Start
Through this quick start, you'll get a meetingbot in your meeting in a matter of seconds.
import { createClient } from '@skribby/sdk';
const client = createClient({
api_key: 'SKRIBBY_API_KEY',
});
const bot = await client.createBot({
bot_name: 'My Meeting Bot',
meeting_url: 'https://meet.google.com/abc-defg-hij',
service: 'gmeet',
transcription_model: 'whisper',
custom_metadata: {
request_id: 'req_123',
customer_id: 'acme-42',
},
});
Listen to realtime transcription
Notice
Your selected transcription_model must support realtime for this to work.
import { createClient } from '@skribby/sdk';
const client = createClient({
api_key: 'SKRIBBY_API_KEY',
});
(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-realtime',
});
const realtimeClient = bot.getRealtimeClient();
realtimeClient.on('ts', (segment) => {
console.log(`${segment.speaker_name} said: ${segment.transcript}`);
// Full transcript so far (array of segments)
console.log('Transcript so far:', realtimeClient.transcript);
});
await realtimeClient.connect();
})();
Basic agentic capabilities
Notice
Your selected transcription_model must support realtime for this to work.
import { createClient } from '@skribby/sdk';
const client = createClient({
api_key: 'SKRIBBY_API_KEY',
});
(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-realtime',
});
const realtimeClient = bot.getRealtimeClient();
realtimeClient.on('ts', (segment) => {
// If the user says "hello", let's say hello back in chat!
if (segment.transcript.toLowerCase().includes('hello')) {
realtimeClient.send('chat-message', {
content: 'Hello back!',
});
}
// If the user says "end the meeting", let's stop the bot.
if (segment.transcript.toLowerCase().includes('end the meeting')) {
realtimeClient.send('stop');
}
});
await realtimeClient.connect();
})();
Fetch bot pricing
Use pricing data if you need to sync bot costs into your own billing or analytics system.
const bot = await client.getBotById('3c09b2aa-6708-42c1-8145-aa55ee223613');
if (bot) {
// Via bot instance
const pricing = await bot.getPricing();
console.log(pricing.total.rate_per_hour);
console.log(pricing.total.amount); // null while in progress, number when finished
}
// Or directly via client + bot id
const pricing = await client.getBotPricing(
'3c09b2aa-6708-42c1-8145-aa55ee223613',
);
console.log(pricing.currency); // USD
If you have more examples you'd like to see, let us know in Discord!