BugSnag is now Insight Hub – we're making some changes to how the product looks, but this won't impact the way you use BugSnag or any of your integrations.

SvelteKit Router

If you use SvelteKit in your app, you can record the timings of app navigation events shown on the BugSnag Performance dashboard.

The package can be installed from the npm registry using npm or yarn:

yarn add @bugsnag/svelte-kit-performance
# or
npm install --save @bugsnag/svelte-kit-performance

To use the plugin, create a new routing provider when you start the BugSnag Performance client, passing it the beforeNavigate, afterNavigate and initialRoute parameters from SvelteKit:

<script>
    import BugsnagPerformance from '@bugsnag/browser-performance'
    import { SvelteKitRoutingProvider } from '@bugsnag/svelte-kit-performance'
    import { beforeNavigate, afterNavigate } from '$app/navigation'
    import { page } from '$app/state'

    BugsnagPerformance.start({
        apiKey: 'YOUR_API_KEY',
        routingProvider: new SvelteKitRoutingProvider(beforeNavigate,
                                                      afterNavigate,
                                                      page.route.id)
    })
</script>