Send custom metadata with bug reports

Updated May 22, 2026

Yaplet automatically captures browser and device metadata with every bug report. But the most useful debugging context is often specific to your application: which user was logged in, which plan they're on, what A/B experiment they were in, what their cart looked like. This data doesn't exist in the DOM β€” you have to push it yourself via the SDK.

Attach a set of key-value pairs

Use Yaplet.attachCustomData() to merge an object into the custom data that gets sent with every bug report and ticket from this visitor:

Yaplet.attachCustomData({
  userId: "u_abc123",
  plan: "pro",
  experiment: "checkout-v2",
  cartValue: 149.99
});

Call this after Yaplet.initialize() and whenever the relevant state changes (for example, after a user logs in or upgrades their plan).

Set or update a single value

Yaplet.setCustomData("cartValue", 149.99);
Yaplet.setCustomData("lastVisitedPage", "/dashboard/billing");

Remove a specific key

Yaplet.removeCustomData("experiment");

Clear all custom data

Call this on logout to avoid sending the previous user's data with the next user's reports:

Yaplet.clearCustomData();

Set ticket-specific attributes

Yaplet.setTicketAttribute() is similar but flags the value as a ticket attribute rather than custom data β€” useful for structured fields your support workflow depends on:

Yaplet.setTicketAttribute("orderId", "ORD-78234");
Yaplet.setTicketAttribute("region", "eu-west-1");

Send a silent crash report programmatically

For JavaScript exceptions caught by your error boundary, you can send a report without any user interaction:

try {
  // risky operation
} catch (err) {
  Yaplet.sendSilentCrashReport(err.message, "HIGH", {
    screenshot: false,
    replays: false
  });
}

The excludeData third parameter lets you omit specific capture types β€” useful when the crash context is entirely server-side and a screenshot would add no value. Priority can be "LOW", "MEDIUM", or "HIGH". Silent reports are rate-limited to one per 10 seconds.

Where custom data appears

In the bug report ticket on your board, the custom data section lists every key-value pair you attached. It sits alongside the screenshot, console logs, and device metadata in the ticket's detail panel.

Did this article answer your question?