Skip to main content
The mountWidget utility mounts your React widget into the #root element provided by the host runtime. It is the standard entrypoint for widget bundles. In development, it also installs a window.openai logging proxy to help debug Apps SDK method calls.

Basic usage

import { mountWidget } from "skybridge/web";
import { MyWidget } from "./my-widget";

mountWidget(<MyWidget />);

Parameters

component

component: React.ReactNode
Required The React tree to render as your widget.

Behavior

  • Requires a DOM element with id root; throws if it is missing.
  • Reuses a single React root instance across repeated calls.
  • Wraps rendering in StrictMode.