What are Events?
Events are timestamped milestones within a trace. They record significant moments in your application flow, such as user actions, state changes, or external interactions.Adding Events
UseaddEvent() to record an event:
With Details
Events can include additional details as a string or object:With Custom Timestamp
By default, events use the current time. You can provide a custom timestamp using aDate object:
Event Patterns
User Interaction Flow
Error Handling
State Transitions
Method Signature
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Event name |
details | string | object | No | Additional context |
options | AddEventOptions | Date | No | Options (e.g. { captureStackTrace: true }) or a Date timestamp |
AddEventOptions
| Option | Type | Default | Description |
|---|---|---|---|
captureStackTrace | boolean | false | Capture stack trace at event location |