Skip to content

unified-live

One TypeScript SDK for YouTube, Twitch, and TwitCasting

Unified API

One interface for YouTube, Twitch, and TwitCasting. Pass a URL — the SDK auto-detects the platform, normalizes the response into Content, Channel, Broadcast, and Archive types.

Plugin Architecture

Install only the platforms you need. Each platform is a separate package (@unified-live/youtube, @unified-live/twitch, @unified-live/twitcasting) with its own auth, rate limiting, and URL resolution.

OpenTelemetry Compatible

Built-in tracing with zero overhead when OTel SDK is not configured. Every API call emits spans with platform, HTTP method, rate limit state, quota consumption, and error details.

Automatic Rate Limiting

Token bucket (Twitch, TwitCasting) and quota-based (YouTube) strategies are handled transparently. The SDK retries with exponential backoff and tracks quota consumption locally.

Zero Required Dependencies

The core package has no runtime dependencies. OpenTelemetry tracing is supported via an optional peer dependency. Plain TypeScript types — no schema libraries, no bloat.

Type-Safe

Discriminated unions (Content covers Broadcast, ScheduledBroadcast, Archive, and Clip). Companion object type guards (Content.isBroadcast(), Content.isArchive(), etc.) for safe narrowing.

Runtime Agnostic

Works on Node.js 18+, Deno, Bun, and Cloudflare Workers — any runtime with native fetch. No Node.js-specific dependencies in the core.

PlatformOfficial APIWhat unified-live handles
YouTubeData API v3Daily quota tracking (10,000 units), API key injection, quota-per-endpoint cost management
TwitchHelix APIOAuth2 Client Credentials auto-refresh, token bucket rate limiting (800 req/60s)
TwitCastingAPI v2Basic auth encoding, token bucket rate limiting (60 req/60s)

Read the Overview for a detailed comparison of each platform’s API challenges.