SDK Reference
The `@probe/trace` SDK is the easiest way to integrate Trace into your JavaScript or TypeScript application.
Installation
npm install @probe/trace
Configuration
Initialize the Trace instance with the following options:
| Option | Type | Default | Description |
|---|---|---|---|
| apiKey | string | required | Your Trace API Key found in the dashboard. |
| environment | string | 'development' | Current environment name (e.g., 'production'). |
| sampleRate | number | 1.0 | Percentage of events to capture (0.0 to 1.0). |
Methods
mount()
Starts the automatic error capturing and performance monitoring.
captureError(error, context?)
Manually capture an exception.
trace.captureError(new Error('Something went wrong'), { userId: 123 });
log(message, level?)
Send a custom log event.
