Skip to content

@moq/lite

npmTypeScript

A TypeScript implementation of Media over QUIC providing real-time data delivery in web browsers. Implements the moq-lite specification.

Overview

@moq/lite is the browser equivalent of the Rust moq-lite crate, providing the core networking layer for MoQ. For higher-level media functionality, use @moq/hang.

Installation

bash
bun add @moq/lite
# or
npm add @moq/lite
pnpm add @moq/lite
yarn add @moq/lite

Quick Start

Basic Connection

See js/lite/examples/connection.ts

Publishing Data

See js/lite/examples/publish.ts

Subscribing to Data

See js/lite/examples/subscribe.ts

Stream Discovery

See js/lite/examples/discovery.ts

Core Concepts

Broadcasts

A collection of related tracks.

Tracks

Named streams within a broadcast, published by the producer and consumed via subscribe.

Groups

Collections of frames (usually aligned with keyframes).

Frames

Individual data chunks.

See the publishing example for usage of all core concepts.

Advanced Usage

Authentication

Pass JWT tokens via query parameters in the URL. See Authentication guide for details and js/token/examples/sign-and-verify.ts for a working example.

Running Server-Side

@moq/lite can also run server-side using a WebTransport polyfill. See the js/lite/README.md for setup instructions.

Browser Compatibility

Requires WebTransport support:

  • Chrome 97+
  • Edge 97+
  • Brave (recent versions)

Firefox and Safari support is experimental or planned.

Examples

For more examples, see:

Protocol Specification

See the moq-lite specification for protocol details.

Next Steps

Licensed under MIT or Apache-2.0