Description of icon
Flex UI
API Reference

Monitor

Monitor API’s are designed to retrieve Error reports and logs programmatically. Flex.Monitor.getLogs returns the current logs and Flex.Monitor.getError returns all recorded errors in an array. You can use these methods to implement special reporting or report handling. You can learn more about troubleshooting Flex UI here


getErrors#

Creates and returns a JSON representation of the error array

Example:

import { Monitor } from "@twilio/flex-ui";
Monitor.getErrors(); // returns { errors: {@link Monitor.FlexErrorJSON}[] }

getLogs#

Creates a dump from the log manager content and returns the formatted data

Example:

import { Monitor } from "@twilio/flex-ui";
Monitor.getLogs(); // returns { logs: string }

sendDebuggerEvent#

Creates and sends a Custom Error Event to Twilio Debugger

Example:

Monitor.sendDebuggerEvent("Connection failed"); // creates and sends error event to Twilio Debugger
Rate this page

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.