Web Viewer - v0.45.0-alpha.1+dev
    Preparing search index...

    Web Viewer - v0.45.0-alpha.1+dev

    Banner with Rerun logo

    Latest version MIT Rerun Discord

    Rerun web viewer

    Rerun is the data layer for physical AI: it logs, stores, queries, and visualizes multi-rate, multimodal data. This package embeds the Rerun Viewer in any web page.

    The package is framework-agnostic, and ships with TypeScript types. For React, use @rerun-io/web-viewer-react.

    npm i @rerun-io/web-viewer
    
    import { WebViewer } from "@rerun-io/web-viewer";

    const rrd = "…";
    const parentElement = document.body;

    const viewer = new WebViewer();
    await viewer.start(rrd, parentElement, { width: "800px", height: "600px" });
    // …
    viewer.stop();

    The Rerun Viewer showing a 3D reconstruction

    The WebViewer class manages a canvas element inside parentElement.

    Always set width and height, or the Viewer may not display correctly. Empty strings are valid if you size the canvas with your own CSS.

    rrd is a URL that points to one of:

    Without an rrd, the Viewer shows the same welcome screen as https://app.rerun.io. To hide it, set hideWelcomeScreen: true in the options of viewer.start.

    The Viewer emits events, and can be driven from code:

    viewer.on("selection_change", (event) => {
    for (const item of event.items) {
    if (item.type === "entity") {
    console.log(item.entityPath);
    }
    }
    });

    await viewer.setTime({ timeline: "frame", sequence: 42, playState: "playing" });

    The methods that drive the Viewer are experimental, and may change between releases. See the Viewer API docs for more.

    By default, the Viewer sends usage data to Rerun, and shows a one-time notice about it. Nothing is sent during a browser's first visit, so users can turn it off first. To send nothing, set analytics: "off" in the options of viewer.start:

    await viewer.start(rrd, parentElement, { analytics: "off" });
    

    Users can always turn usage data off in the Viewer's settings, which overrides "on". If your app leaves usage data on, consider mentioning Rerun in your privacy policy. See the Rerun privacy policy for what is collected.

    The package version matches the Rerun SDK version. The Viewer reads .rrd files written by the same SDK version, and by any older version from 0.23 on. A Viewer is not guaranteed to read data from a newer SDK, so keep the package at least as new as the SDK that writes your data. See RRD file backwards compatibility for details.

    The package targets recent browsers. If your target browser does not support Wasm imports or top-level await, your bundler may need extra plugins. For example, Vite needs vite-plugin-wasm and vite-plugin-top-level-await.