Using highlight.io with SvelteKit
Install the npm package
highlight.run in your terminal.
In SvelteKit, we recommend initializing highlight.io in the
hooks.client.ts file. You can find more details about this file in the SvelteKit docs here. To get started, we recommend setting
networkRecording so that we can pass a header to pair frontend and backend errors.
Grab your project ID from app.highlight.io/setup, and pass it as the first parameter of the
SvelteKit may generate CSS paths that are relative which may interfere with our logic to fetch stylesheets. Update your
svelte.config.js to disable relative paths. See the SvelteKit docs here for more details.
Identify users after the authentication flow of your web app. We recommend doing this in any asynchronous, client-side context.
The first argument of
identify will be searchable via the property
identifier, and the second property is searchable by the key of each item in the object.
The next step is instrumenting your backend to tie logs/errors to your frontend sessions. Read more about this in our backend instrumentation section.