---
title: Sending custom events
description: Send custom events from JavaScript applications to Honeybadger Insights for monitoring and analysis.
url: https://docs.honeybadger.io/lib/javascript/insights/sending-events-to-insights/
---

You can send your own application events to [Honeybadger Insights](https://docs.honeybadger.io/guides/insights/) using the `Honeybadger.event` method. (To capture console logs automatically, see [Capturing logs](https://docs.honeybadger.io/lib/javascript/insights/capturing-logs/).)

```javascript
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](https://docs.honeybadger.io/_astro/event-detail.FXaPoHe__IfKOV.webp)

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

```javascript
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.

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
