Vue.js (coming soon)
Composables

Composables

⚠️

Not available yet. TracePath does not publish a Vue package, so the composable described here cannot be imported today. See OpenTelemetry for the integration path that works now.

A single composable will expose the capture API inside components, reading the client the plugin injected.

Planned surface

FunctionDescription
captureException(error)Capture an error with its stack trace
captureExceptionWithAttributes(error, attributes)Capture an error with extra context attached
captureMessage(message)Send a non-error event. See Messages
recordAction(category, name, data)Drop a breadcrumb into the session action timeline

Calling it without the plugin installed will throw, which surfaces a missing plugin at development time instead of silently dropping every event.

Where to call it

The plugin's error handler already covers render, watcher and lifecycle errors, and the SDK already covers uncaught errors and unhandled rejections. What is left for the composable is the middle ground where an error never becomes uncaught: a try/catch inside an event handler, an async call whose rejection you handle yourself, anywhere you show the user a friendly message and swallow the original.

Attribute values must be strings

The ingest endpoint types attributes as a string map and rejects the whole upload with 400 Bad Request if any value is a number, boolean or object. The SDK re-queues a rejected batch and retries it, so one bad value blocks every later exception and message from that page too. Convert values before attaching them — a numeric prop passed straight through is the usual way this happens.

recordAction

A recorded action does not create an issue on its own. It joins the rolling action buffer next to the automatic network and navigation entries and ships with the next exception captured in the same session, which is what turns a bare stack trace into a sequence you can read.

Options API

The injection key will be exported directly, so an Options API component can declare it under inject and call the same functions without the composable.

Related