Skip to content

Sending custom events

View Markdown

You can send your own application events to Honeybadger Insights using the Honeybadger.event method. (To capture console logs automatically, see Capturing logs.)

Honeybadger.event("button_click", {
action: "buy_now",
user_id: 123,
product_id: 456,
});

The first argument is the type of the event (event_type) and the second argument is an object containing any additional data you want to include.

Example Event from Honeybadger Js

Honeybadger.event can also be called with a single argument as an object containing the data for the event:

Honeybadger.event({
event_type: "button_click",
action: "buy_now",
user_id: 123,
product_id: 456,
});

A timestamp field (ts) will be automatically added to the event data if it is not provided, regardless of the method overload used to send the event.