@openuidev/devtools
API reference for the development-only devtools widget.
Development-only UI widget for OpenUI apps. Renders a floating button that opens a left side drawer listing the events captured by @openuidev/observability — level, a one-line summary, and a drill-in stack trace per entry. Development only visibility is controlled by the environment flag.
Install
pnpm add -D @openuidev/devtools @openuidev/observabilityOpenUIDevtools
Mount it once, anywhere in your tree. It renders nothing in production builds (NODE_ENV === "production") unless enabled is passed explicitly.
import { OpenUIDevtools } from "@openuidev/devtools";
function App() {
return (
<>
{/* your app */}
{process.env.NODE_ENV === "development" && <OpenUIDevtools />}
</>
);
}Props
| Prop | Default | Description |
|---|---|---|
enabled | dev-only | Force the widget on/off. |
position | "bottom-right" | Corner for the toggle button: top-left/top-right/bottom-*. |
maxEvents | 50 | How many events to keep; oldest are dropped first. |
errorsOnly | true | Capture only error/warning events, or every event. |
autoOpenOnError | true | Initial state of the drawer's "auto-open on error" checkbox. |
bus | shared singleton | An Observability instance to listen to. |