TypeScript SDK
SDK v5 is here, redesigned
The TypeScript SDK is the officially supported package that empowers developers to integrate with the Meeting BaaS API - the universal interface for automating meetings across Google Meet, Zoom, and Microsoft Teams.
🚀 New in v5.0.0: Complete architectural redesign with improved TypeScript support, better error handling, and enhanced developer experience. See the migration guide for upgrade instructions.
- Complete type safety with comprehensive TypeScript definitions
- Automatic updates synced with our OpenAPI specification
- Simplified access to all meeting automation capabilities
- Cross-platform consistency for all supported meeting providers
- Enhanced error handling with discriminated union responses
- Parameter validation with automatic Zod schema validation
- Tree-shakeable bundle for better performance
Key Features
- BaaS API Client: Strongly typed functions for interacting with the Meeting BaaS API
- Bot Management: Create, join, and manage meeting bots across platforms
- Calendar Integration: Connect calendars and automatically schedule meeting recordings
- Complete API Coverage: Access to all Meeting BaaS API endpoints
- TypeScript Support: Full TypeScript definitions for all APIs
- Enhanced Error Handling: Discriminated union responses for type-safe error handling
- Parameter Validation: Automatic Zod schema validation for all API calls
- Tree-shakeable: Only import the methods you need
- Comprehensive Testing: Full test coverage with MSW mocking
System Requirements
- Node.js: Version 18.0.0 or higher
- Package Managers: npm, yarn, or pnpm
Tested Node.js Versions: 18, 19, 20, 21, 22
Installation
Install the Meeting BaaS SDK using your preferred package manager:
npm install @meeting-baas/sdk
yarn add @meeting-baas/sdk
pnpm add @meeting-baas/sdk
Quick Start
Create a new instance of the BaaS client with your API key:
import { createBaasClient } from "@meeting-baas/sdk";
// Create a BaaS client
const client = createBaasClient({
api_key: "your-api-key", // Get yours at https://meetingbaas.com
});
async function example() {
// Join a meeting
const { success, data, error } = await client.joinMeeting({
bot_name: "Meeting Assistant",
meeting_url: "https://meet.google.com/abc-def-ghi",
reserved: true,
});
if (success) {
console.log("Bot joined successfully:", data.bot_id);
} else {
console.error("Error joining meeting:", error);
}
}
import { createBaasClient } from "@meeting-baas/sdk";
const client = createBaasClient({
api_key: "your-api-key",
timeout: 60000
});
async function comprehensiveExample() {
// Join a meeting with all options
const joinResult = await client.joinMeeting({
meeting_url: "https://meet.google.com/abc-defg-hij",
bot_name: "Advanced Test Bot",
reserved: false,
bot_image: "https://example.com/bot-image.jpg",
enter_message: "Hello from the advanced test bot!",
extra: { test_id: "advanced-example" },
recording_mode: "speaker_view",
speech_to_text: { provider: "Gladia" },
webhook_url: "https://example.com/webhook"
});
if (joinResult.success) {
const botId = joinResult.data.bot_id;
console.log("Bot joined with ID:", botId);
// Get meeting data with transcripts
const meetingDataResult = await client.getMeetingData({
bot_id: botId,
include_transcripts: true
});
if (meetingDataResult.success) {
console.log("Meeting duration:", meetingDataResult.data.duration);
}
}
}
Calendar Integration
The SDK provides full calendar integration capabilities:
import { createBaasClient } from "@meeting-baas/sdk";
const client = createBaasClient({
api_key: "your-api-key",
});
// Create a calendar integration
const calendarResult = await client.createCalendar({
oauth_client_id: "your-oauth-client-id",
oauth_client_secret: "your-oauth-client-secret",
oauth_refresh_token: "your-oauth-refresh-token",
platform: "Google",
});
if (calendarResult.success) {
console.log("Calendar created:", calendarResult.data);
// List all calendars
const calendarsResult = await client.listCalendars();
if (calendarsResult.success) {
console.log("All calendars:", calendarsResult.data);
}
// List events from a calendar
const eventsResult = await client.listCalendarEvents({
calendar_id: calendarResult.data.calendar.uuid,
start_date_gte: new Date().toISOString(),
start_date_lte: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString()
});
if (eventsResult.success) {
console.log("Events:", eventsResult.data);
}
}
Error Handling
The SDK provides type-safe error handling with discriminated union responses:
import { createBaasClient } from "@meeting-baas/sdk";
const client = createBaasClient({
api_key: "your-api-key",
});
const result = await client.joinMeeting({
meeting_url: "https://meet.google.com/abc-def-ghi",
bot_name: "My Bot",
reserved: false
});
if (result.success) {
// TypeScript knows result.data is JoinResponse
console.log("Bot ID:", result.data.bot_id);
} else {
// TypeScript knows result.error is ZodError | Error
if (result.error instanceof ZodError) {
console.error("Validation error:", result.error.errors);
} else {
console.error("API error:", result.error.message);
}
}
Migration from v4.x
If you're upgrading from v4.x, see the migration guide for detailed migration instructions.
