The LiveKit Server SDK, currently at version 2.15.1, provides a comprehensive set of APIs for managing LiveKit rooms, generating access tokens, and processing webhooks from a server-side JavaScript, TypeScript, Node.js, Deno, or Bun environment. This SDK is actively maintained with frequent patch releases, as evidenced by recent updates addressing memory leaks and adding new features like `ringingTimeout` for SIP participants. A key differentiator of this SDK is its multi-runtime compatibility, supporting Node.js (>=18), Deno, and Bun, a significant evolution from its v1 predecessor which was primarily Node.js focused. It allows developers to programmatically control aspects of LiveKit sessions, such as listing, creating, and deleting rooms, and assigning granular permissions to participants joining rooms. The library ships with TypeScript types, facilitating robust development. While it theoretically runs in browsers, the documentation strongly advises against it due to security implications of exposing API secrets.
npm install livekit-server-sdkVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to generate an access token for a LiveKit participant to join a specified room, including setting basic permissions and token expiration.
Consult the official LiveKit Server SDK v2 migration guide for detailed instructions on updating your codebase.
Ensure that the `livekit-server-sdk` is only used on your backend, and that API keys/secrets are managed securely (e.g., environment variables, secret management services) and never transmitted to the client.
For Express.js, use `app.use(express.raw({type: 'application/webhook+json'}));` before your webhook route handler to get the raw body string required by `WebhookReceiver` for verification.Double-check your `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET` environment variables or constructor arguments. Ensure they match the credentials from your LiveKit Cloud project or self-hosted instance.
Ensure `express` is imported and `express.raw()` is correctly configured for the webhook endpoint: `import express from 'express'; const app = express(); app.use(express.raw({type: 'application/webhook+json'}));`If your project is ESM-first (e.g., `"type": "module"` in `package.json`), use `import { ... } from 'livekit-server-sdk';`. If your project is CJS, you might need to ensure your transpilation setup is correct or check if an older CJS-compatible version is available (though v2 is primarily ESM).No dependency data recorded yet.