
@vercel/speed-insights automatically tracks web vitals and other performance metrics for your website.
This package does not track data in development mode.
It has 1st class integration with:
| Framework | Package |
|---|---|
| Next.js | @vercel/speed-insights/next |
| Nuxt | @vercel/speed-insights/nuxt |
| SvelteKit | @vercel/speed-insights/sveltekit |
| SvelteKit 3 | @vercel/speed-insights/sveltekit-next |
| Remix | @vercel/speed-insights/remix |
| React | @vercel/speed-insights/react |
| Astro | @vercel/speed-insights/astro |
| Vue | @vercel/speed-insights/vue |
It also supports other frameworks, vanilla JS and static websites.
@vercel/speed-insights package to your project<SpeedInsights /> component to inject the script into your app.injectSpeedInsights() function from @vercel/speed-insights/sveltekit in your top-level +layout.js/ts file.injectSpeedInsights() from @vercel/speed-insights/sveltekit-next instead.inject function add the tracking script to your app.To disable performance reporting for client-side navigations, set softNavs to false when you initialize Speed Insights. Hard-navigation reporting is not affected.
For React, Next.js, Remix, and Astro components:
<SpeedInsights softNavs={false} />
For Vue and Nuxt components, bind the boolean value:
<SpeedInsights :soft-navs="false" />
For injectSpeedInsights, including the SvelteKit and Nuxt runtime integrations:
injectSpeedInsights({ softNavs: false });
Find more details about this package in our documentation.