Skip to main content

DebugPanel

Debug panel component, used to view events and status during development.

Basic Usage

import {PilotKit, DebugPanel} from '@bdky/aaas-pilot-kit-react-widget';
import '@bdky/aaas-pilot-kit-react-widget/styles.css';

function App() {
return (
<PilotKit {...props}>
<DebugPanel
show={process.env.NODE_ENV === 'development'}
position="bottom-right"
/>
</PilotKit>
);
}

Features

DebugPanel can display the following information:

  • Event logs: Various events triggered by the SDK (ready, asrMessage, conversationChange, etc.)
  • Status changes: States such as isReady, isMuted, isRendering, etc.
  • Performance metrics: TTFT (Time To First Token) and other performance data

Props

PropertyTypeDefaultDescription
showbooleanfalseWhether to show panel
position'top-left' | 'top-right' | 'bottom-left' | 'bottom-right''bottom-right'Panel position
classNamestring-Custom class name
styleCSSProperties-Custom style
featuresobjectSee belowEnabled features
maxLogsnumber100Maximum number of logs

features Configuration

<DebugPanel
show
features={{
events: true, // Show event logs
performance: true, // Show performance metrics
state: true // Show status changes (every 5 seconds)
}}
/>
PropertyTypeDefaultDescription
eventsbooleantrueWhether to show event logs
performancebooleantrueWhether to show performance metrics
statebooleantrueWhether to show status changes

Log Types

Logs in the panel are color-coded by type:

TypeColorDescription
eventBlueSDK events
stateGreenStatus changes
performanceYellowPerformance metrics

Interactive Features

  • Clear button: Clear all logs
  • Collapse/Expand: Click ▼/▲ button to toggle panel size

Style Customization

Class NameDescription
.apk-debug-panelRoot container
.apk-debug-panel--expandedExpanded state
.apk-debug-panel--collapsedCollapsed state
.apk-debug-panel--top-leftTop-left position
.apk-debug-panel--top-rightTop-right position
.apk-debug-panel--bottom-leftBottom-left position
.apk-debug-panel--bottom-rightBottom-right position
.apk-debug-panel__headerHeader area
.apk-debug-panel__titleTitle
.apk-debug-panel__actionsAction button area
.apk-debug-panel__buttonButton
.apk-debug-panel__contentContent area
.apk-debug-panel__logSingle log entry
.apk-debug-panel__log--eventEvent log
.apk-debug-panel__log--stateStatus log
.apk-debug-panel__log--performancePerformance log
.apk-debug-panel__log-timeTimestamp
.apk-debug-panel__log-typeType label
.apk-debug-panel__log-messageMessage content
.apk-debug-panel__log-dataData details
.apk-debug-panel__emptyEmpty state

Usage Recommendations

Only use in development environment

DebugPanel continuously listens to events and status, which may affect performance. It's recommended to only enable in development environment:

<DebugPanel show={process.env.NODE_ENV === 'development'} />

Monitored Events

DebugPanel automatically monitors the following events:

EventDescription
onReadySDK ready
onAsrStartASR started
onAsrMessageASR recognition result
onRenderStartStarted rendering
onInactivityUser inactivity
onBusySystem busy
onInterruptRendering interrupted
onConversationChangeConversation changed
onIsRenderingChangeRendering status changed
onReplyStartReply started
onTtftFirst token latency metric