> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traceback.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Events & Errors

> How exceptions, unhandled rejections, and custom messages are captured and structured.

In Traceback, an **Event** is an immutable record capturing a single anomaly, exception, or telemetry message.

## Event Schema

Every event processed by Traceback contains standard contextual properties:

| Field         | Type                     | Description                                            |
| :------------ | :----------------------- | :----------------------------------------------------- |
| `id`          | `UUID`                   | Unique identifier for the event.                       |
| `timestamp`   | `ISO 8601`               | Precise client/server timestamp.                       |
| `environment` | `string`                 | Deployment environment (e.g. `production`, `staging`). |
| `release`     | `string`                 | Application version or git commit SHA.                 |
| `exception`   | `object`                 | Exception type, value, and stack frames.               |
| `user`        | `object`                 | Optional identified user ID, username, or email.       |
| `tags`        | `Record<string, string>` | Searchable key-value metadata.                         |
| `breadcrumbs` | `Array<Breadcrumb>`      | Chronological trail of events prior to the crash.      |

***

## Capturing Exceptions Manually

In addition to automatic crash interception, you can capture caught exceptions manually:

```typescript theme={null}
import * as Traceback from "@traceback/browser";

try {
  await processPayment(cart);
} catch (error) {
  Traceback.captureException(error, {
    level: "error",
    tags: {
      paymentProvider: "stripe",
      cartTotal: cart.total.toString(),
    },
    extra: {
      cartItemsCount: cart.items.length,
    },
  });
}
```

***

## Breadcrumbs

Breadcrumbs provide a timeline of user and application activities immediately preceding an error:

```typescript theme={null}
Traceback.addBreadcrumb({
  category: "navigation",
  message: "User clicked checkout button",
  level: "info",
  data: {
    source: "/cart",
    target: "/checkout",
  },
});
```
