Architecture
The SDK is organized in layers, from low-level protocol implementation to high-level UI components:Package Overview
@moq/lite
Core pub/sub protocol implementation. Work with connections, broadcasts, tracks, and groups.
@moq/hang
Media-specific layer with WebCodecs integration, catalog and container formats.
@moq/watch
Watch/subscribe to live streams with Web Component and JavaScript API.
@moq/publish
Publish live media from camera or screen with Web Component and JavaScript API.
@moq/signals
Reactive and safe signals library for state management.
@moq/ui-core
Shared UI components (Button, Icon, Stats) and CSS theme system.
@moq/token
JWT token generation and validation for authentication.
@moq/clock
Clock synchronization example for distributed systems.
Key Features
- Browser-first: Built for WebTransport and WebCodecs APIs
- Reactive: Built on signals for efficient state management
- Modular: Use only what you need, from protocol to UI
- TypeScript: Fully typed with excellent IDE support
- Standards-based: Implements IETF MoQ specifications
Package Details
Core Packages
@moq/lite - v0.1.5- Generic pub/sub protocol on top of WebTransport
- Core exports:
Connection,Broadcast,Track,Group,Path,Time - Browser and Node.js support (with polyfill)
- Media encoding/decoding for WebCodecs
- Exports:
Catalog,Container, utilities - Handles audio/video bitstreams and codec configuration
- Reactive signals implementation
SignalandEffectclasses for reactive programming- React and Solid.js adapters
Web Components
@moq/watch - v0.2.2<moq-watch>web component for watching streams- JavaScript API for programmatic control
- Built with Solid.js
<moq-publish>web component for publishing streams- Camera and screen capture support
- Built with Solid.js
- Shared UI components:
Button,Icon,Stats - CSS variables and theme system
- Reusable across watch and publish packages
Utilities
@moq/token - v0.1.1- JWT token generation and validation
- CLI tool:
moq-token - Used for authenticating with MoQ relays
- Clock synchronization example
- CLI tool:
moq-clock - Demonstrates pub/sub patterns
Getting Started
Check out the Getting Started guide to begin using the TypeScript SDK.Source Code
All packages are open source and available in the moq-dev/moq repository under/js/.