> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # enableDebugEvents > Enable real-time debug event webhooks from the AI module during calls. [on-debug-event]: /docs/server-sdks/reference/typescript/agents/agent-base/on-debug-event [ref-agentbase]: /docs/server-sdks/reference/typescript/agents/agent-base Enable real-time debug event webhooks from the AI module during calls. When enabled, the SDK automatically wires a `debug_webhook_url` into the AI parameters and registers a `/debug_events` endpoint that receives event POSTs from the SignalWire platform. Events are logged via the agent's structured logger. Optionally, register a custom handler by overriding [`onDebugEvent()`][on-debug-event] to react to events programmatically. ## **Parameters** **`level`** `number` — default: 1 Debug event verbosity level. * `1` -- High-level events: barge, errors, session start/end, step changes * `2+` -- Adds high-volume events: every LLM request/response, `conversation_add` --- ## **Returns** [`AgentBase`][ref-agentbase] -- Returns `this` for method chaining. ## **Example** ```typescript {5} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'debug-agent', route: '/debug' }); agent.setPromptText('You are a helpful assistant.'); agent.enableDebugEvents(1); await agent.serve(); ``` > Enable real-time debug event webhooks from the AI module during calls.