Skip to content

TypeScript / JavaScript

A significant feature of MoQ is that it is available on web browsers using WebTransport. This allows for real-time media streaming directly in the browser without the need for additional plugins or software. We provide a JavaScript client library to facilitate this integration.

  • A runtime with WebTransport support — a modern browser, or Deno
  • A package manager that can install from JSR: deno, npm, pnpm, yarn, or bun
  1. Install module

    The client library is published to JSR as @qumo/moq.

    Terminal window
    deno add jsr:@qumo/moq
  2. Importing modules

    import { connect } from "@qumo/moq";
    const session = await connect("https://localhost:4443/moq");
    // subscribe resolves to a [value, error] tuple — always check the error
    // before using the reader.
    const [reader, err] = await session.subscribe("/broadcast", "video");
    if (err !== undefined) {
    throw err;
    }
    // reader is a TrackReader here.
    Entrypoint Description
    @qumo/moq Core MoQ client — sessions, tracks, groups, and frames.
    @qumo/moq/msf MSF streaming format — catalogs, deltas, and timelines.