Getting Started
Requirements
Section titled “Requirements”- Node.js 18+ (or any runtime with native
fetch: Deno, Bun, Cloudflare Workers) - Platform API credentials (see Platform Plugins)
Installation
Section titled “Installation”Install the core package and the platform plugins you need:
# Core + YouTubepnpm add @unified-live/core @unified-live/youtube
# Core + all platformspnpm add @unified-live/core @unified-live/youtube @unified-live/twitch @unified-live/twitcastingQuick Start
Section titled “Quick Start”import { UnifiedClient } from "@unified-live/core";import { createYouTubePlugin } from "@unified-live/youtube";import { createTwitchPlugin } from "@unified-live/twitch";
// 1. Create a client with platform plugins// The trailing `!` is a non-null assertion — make sure the env vars are setconst client = UnifiedClient.create({ plugins: [ createYouTubePlugin({ apiKey: process.env.YOUTUBE_API_KEY! }), createTwitchPlugin({ clientId: process.env.TWITCH_CLIENT_ID!, clientSecret: process.env.TWITCH_CLIENT_SECRET!, }), ],});
// 2. Fetch content by URL — the client auto-detects the platformconst content = await client.resolve("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
console.log(content.title); // Video titleconsole.log(content.platform); // "youtube"console.log(content.type); // "broadcast", "scheduled", "archive", or "clip"Next Steps
Section titled “Next Steps”- Overview — Why unified-live and platform API comparison
- Core Concepts — Content, Channel, and type system
- Platform Plugins — Configuration for each platform
- Error Handling — Handling API errors gracefully