Getting Started
Learn how to install and use the Meeting BaaS TypeScript SDK.
This guide uses v2 API, the recommended version for new projects. Get your API key at dashboard.meetingbaas.com.
Install the Package
Install the Meeting BaaS SDK using your preferred package manager:
npm install @meeting-baas/sdkpnpm add @meeting-baas/sdkyarn add @meeting-baas/sdkCreate a Client
Create a new instance of the BaaS client with your API key:
import { createBaasClient } from "@meeting-baas/sdk";
// Create a v2 BaaS client (recommended for new projects)
const client = createBaasClient({
api_key: "your-api-key", // Get yours at https://dashboard.meetingbaas.com
api_version: "v2"
});Make sure to keep your API key secure and never expose it in client-side code.
Invoke Meeting BaaS methods
With this client instance created, you can call Meeting BaaS methods, such as:
// Create a bot to join a meeting
const { success, data, error } = await client.createBot({
bot_name: "Meeting Assistant",
meeting_url: "https://meet.google.com/abc-def-ghi",
});
if (success) {
console.log("Bot created successfully:", data.bot_id);
} else {
console.error("Error creating bot:", error);
}// Have a bot leave the meeting
const { success, data, error } = await client.leaveBot({
bot_id: "123e4567-e89b-12d3-a456-426614174000"
});
if (success) {
console.log("Bot left the meeting successfully");
} else {
console.error("Error leaving meeting:", error);
}