Instance API
All methods below are available on the object returned by useNetworkDashboard(), on this.$networkDashboard in the Options API, or on the instance returned by createNetworkDashboard().
Reactive state
| Property | Type | Description |
|---|---|---|
logs | Ref<UnifiedLogEntry[]> | All stored log entries |
totalRequests | Ref<number> | Total number of entries |
totalErrors | Ref<number> | Entries where error.occurred === true or http.status >= 400 |
averageDuration | Ref<number> | Mean duration in milliseconds |
totalDataSent | Ref<number> | Sum of request.bodySize across all entries |
totalDataReceived | Ref<number> | Sum of response.bodySize across all entries |
mockGroups | Ref<readonly MockRulesGroup[]> | All mock groups with their rules |
breakpointRules | Ref<BreakpointRule[]> | All configured breakpoint rules |
activeBreakpoints | Ref<ActiveBreakpoint[]> | Requests currently paused at a breakpoint |
Control methods
typescript
enable() // Start capturing
disable() // Stop capturing (existing logs are preserved)
isEnabled() // Returns boolean
clear() // Remove all stored logs (triggers onFlush callback)Query methods
typescript
// Filter by transport type
getLogsByType('http' | 'websocket' | 'sse'): UnifiedLogEntry[]
// Filter by URL string or regex
getLogsByUrl('/api/users'): UnifiedLogEntry[]
getLogsByUrl(/^https:\/\/api\./): UnifiedLogEntry[]
// Filter by HTTP status range
getLogsByStatus([400, 599]): UnifiedLogEntry[] // all 4xx and 5xx
// Filter by HTTP method
getLogsByMethod('POST'): UnifiedLogEntry[]
// Only failed entries
getErrorLogs(): UnifiedLogEntry[]
// Composable query with multiple filters at once
queryLogs({
type: 'http',
method: 'GET',
url: /\/api\//,
minDuration: 500,
hasError: false,
}): UnifiedLogEntry[]Export
typescript
export() // JSON string (default)
export('json') // JSON string
export('csv') // CSV string with header rowStatistics
typescript
getStats(): NetworkStats // Full statistics object (see Statistics section)
getStatsSummary(): string // Multi-line human-readable textSubscription
typescript
const unsubscribe = subscribe((entry: UnifiedLogEntry) => {
// called synchronously after each log entry is stored
})
unsubscribe() // stop receiving eventsMock methods
typescript
// Legacy flat API (proxied into the default group)
addMock(rule): MockRule
removeMock(id: string): void
getMocks(): MockRule[]
// Group management
addMockGroup(name: string): string // returns groupId
renameMockGroup(groupId: string, name: string): void
toggleMockGroup(groupId: string, enabled: boolean): void
removeMockGroup(groupId: string): void
// Rules within a group
addMockToGroup(groupId: string, rule: Partial<MockRule>): MockRule
updateMockInGroup(groupId: string, ruleId: string, patch: Partial<MockRule>): void
removeMockFromGroup(groupId: string, ruleId: string): void
// Bulk replace (used by import)
replaceMockGroups(groups: MockRulesGroup[]): voidThrottle methods
typescript
setThrottle(preset: 'none' | 'fast3g' | 'slow3g' | 'offline'): void
getThrottleDelay(): number // current delay in millisecondsBreakpoint methods
typescript
// Rule management
addBreakpointRule(rule: Omit<BreakpointRule, 'id'>): BreakpointRule
removeBreakpointRule(id: string): void
updateBreakpointRule(id: string, patch: Partial<BreakpointRule>): void
getBreakpointRules(): BreakpointRule[]
// Controlling paused requests
releaseBreakpoint(id: string, edits: BreakpointEdits): void
cancelBreakpoint(id: string): void // throws AbortError in the caller
getActiveBreakpoints(): ActiveBreakpoint[]
// Subscribe to changes in the paused set
onActiveBreakpointsChange(cb: (list: ActiveBreakpoint[]) => void): () => voidTypes:
typescript
interface BreakpointRule {
id: string
urlPattern: string | RegExp
method?: string // e.g. 'POST'; omit to match any method
name?: string
enabled: boolean
}
interface ActiveBreakpoint {
id: string
url: string
method: string
requestHeaders: Record<string, string>
requestBody: unknown
timestamp: number
}
interface BreakpointEdits {
url: string
method: string
headers: Record<string, string>
body: string | null
}