BugMuncher Documentation

Javascript Events


on_ready

The on_ready event is triggered as soon a the BugMuncher widget is loaded and ready for use, ie: as soon as the feedback button has been added to your webpage. There are no arguments passed to the on_ready event handler.

Example:

var bugmuncher_options = {
  api_key: "[YOUR API KEY HERE]",
  on_ready: function() {
    alert('BugMuncher is ready!');
  }
};

on_open

The on_open event is triggered when the BugMuncher button is clicked, or the widget is opened using the bugmuncher.open() Javascript API method. There are no arguments passed to the on_open event handler.

Example:

var bugmuncher_options = {
  api_key: "[YOUR API KEY HERE]",
  on_open: function() {
    alert('BugMuncher opened!');
  }
};

on_complete

The on_complete event is triggered when a feedback report is submitted through BugMuncher. A Javascript hash containing details about the submitted feedback report is passed the event handler, in the following format:
{
  feedback_report: {
    id: "a1b2c3d4e5f6",
    custom_data: {
      user_id: 12345,
    },
    viewport_width: 1280,
    viewport_height: 720,
    url: "https://app.bugmuncher.com",
    plugins: [
      "Widevine Content Decryption Module",
      "Chrome PDF Viewer",
      "Shockwave Flash",
      "Chrome Remote Desktop Viewer",
      "Native Client"
    ],
    sender_email: "[email protected]",
    description: "This is a bug!",
    events: [
      {
        url: "https://app.bugmuncher.com",
        method: "GET",
        timestamp: "Mon Oct 19 2015 13:51:17 GMT+0100 (BST)",
        type: "page_load",
      },
      {
        content: "Feedback Button Clicked",
        timestamp: "Mon Oct 19 2015 13:51:27 GMT+0100 (BST)",
        type: "bugmuncher",
      },
      {
        content: "Feedback Report Submitted",
        timestamp: "Mon Oct 19 2015 13:51:37 GMT+0100 (BST)",
        type: "bugmuncher",
      }
    ]
  }
}
Note: For legacy reasons the data is also duplicated in the report key.

Example:

var bugmuncher_options = {
  api_key: "[YOUR API KEY HERE]",
  on_complete: function(data) {
    alert('Report submitted by '+data.report.sender_email+'!');
  }
};

on_cancel

The on_cancel event is triggered when a user manually closes BugMuncher without submitting a feedback report. There are no arguments passed to the on_cancel event handler.

Example:

var bugmuncher_options = {
  api_key: "[YOUR API KEY HERE]",
  on_cancel: function() {
    alert('BugMuncher canceled!');
  }
};

on_close

The on_close event is triggered when the BugMuncher widget is closed, either by user interaction or through the bugmuncher.close() Javascript API method. This event will be triggered regardless of whether a feedback report was submitted or not, and will alays be triggered after on_complete or on_cancel is triggered. There are no arguments passed to the on_close event handler.

Example:

var bugmuncher_options = {
  api_key: "[YOUR API KEY HERE]",
  on_close: function() {
    alert('BugMuncher closed!');
  }
};