Svelte (coming soon)
Overview

Svelte

⚠️

Not available yet. TracePath does not publish a Svelte package. There is nothing to install, and the @tracepath scope on npm belongs to an unrelated third party — do not run an install command against it. This page describes the planned integration. Email [email protected] to hear when it ships.

The planned Svelte package will wrap the browser SDK in Svelte's context API: one setup call in the root layout, and a getter in any component below it.

What it will give you

PieceRole
Context setupInitializes the SDK and puts the capture functions into Svelte context
SvelteKit hooksCapture from handleError in hooks.client.js, where SvelteKit hands you the real error
Boundary supportReport errors caught by Svelte 5's <svelte:boundary>

Session recording will be on by default, shipping the last ~30 s of DOM events with each captured exception.

One SvelteKit-specific thing to plan for: the setup call must not be wrapped in a browser guard. It is what puts the capture functions into context, so skipping it during SSR makes every child component's getter throw and the page return a 500. Running it on the server is safe — the recorder and the fetch/XHR instrumentation only start where window exists. See Context Setup.

What to do today

If your SvelteKit app has a server half, instrument it now with OpenTelemetry — that half is fully supported. See Node.js. The browser half and the server half are two separate TracePath projects with two separate tokens either way; see Project Structure.

For a pure client-side app, synthetic monitors can watch it from the outside today with no code in the page.

Distributed tracing

The backend side of frontend-to-backend correlation is already implemented and worth adding now: your server reads a tracepath-trace-id header and puts it on its span. See Distributed Tracing.