Documentation

Capture

Platform hooks catch most errors automatically. Use captureException when you handle them yourself.

Automatic

After init, the SDK registers global handlers — window in the browser, process in Node. See Browser or Node.js for what each platform captures.

Same errors group into one issue by fingerprint. Repeated throws bump the event count, not the issue list.

Manual

Errors inside try/catch never reach the global handler:

import { captureException } from '@retrace-kit/sdk';

try {
  await saveProfile();
} catch (error) {
  captureException(error);
}

Per-event overrides:

captureException(error, {
  message: 'Profile save failed',
  environment: 'staging',
});

Never throws into your app. No API key or enabled: false → silent no-op.

Payload

Field Source
message, stacktrace, name error object
url page (browser) or serverUrl (Node)
userAgent navigator or Node.js/…
release, environment init
user setUser
breadcrumbs addBreadcrumb + network patch
sessionId session
tags setTag

Skipped

Resource load failures (<img>, <script>) without a JS exception are ignored — no stack to parse.