The @laioutr/app-vercel-speed-insights package integrates Vercel Speed Insights into a Laioutr-powered Nuxt app. It does not register any orchestr handlers; instead it registers a page wrapper with Laioutr and adds the official @vercel/speed-insights Nuxt component so that real-user performance data is collected on every page rendered through that wrapper.
The package uses @vercel/speed-insights under the hood. The wrapper component renders the default slot (your page content) and the <SpeedInsights /> component from @vercel/speed-insights/nuxt, passing an optional sample rate from runtime config. The module installs @laioutr-core/frontend-core on prepare and registers VercelSpeedInsightsWrapper as a global component and as Laioutr’s page wrapper.
The module expects configuration under the key @laioutr/app-vercel-speed-insights in nuxt.config.ts (or via runtimeConfig). All options are optional; defaults are applied if omitted.
| Option | Type | Description |
|---|---|---|
sampleRate | number | Fraction of page views to report (0–1). Default: 1 (100%). Lower values reduce data volume. Exposed to the client via public runtime config and passed to <SpeedInsights :sample-rate="..." />. |
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@laioutr/app-vercel-speed-insights'],
'@laioutr/app-vercel-speed-insights': {
sampleRate: 1, // 100% (default); use e.g. 0.1 for 10%
},
});
registerLaioutrApp({ pageWrapper: ["VercelSpeedInsightsWrapper"] }). When your app uses Laioutr’s layout/page wrapper stack, this wrapper wraps the page and mounts the Vercel Speed Insights Nuxt component (<SpeedInsights :sample-rate="config.sampleRate ?? 1" />), so real-user metrics (e.g. Web Vitals) are sent to Vercel.sampleRate is merged into public runtime config so the wrapper can read it on the client and pass it to <SpeedInsights />.<VercelSpeedInsightsWrapper>...</VercelSpeedInsightsWrapper>) if you are not relying on Laioutr’s page wrapper for that route.This package does not provide orchestr queries, actions, links, or resolvers. It only adds Vercel Speed Insights to the client via the page wrapper (or the global component).
@laioutr/app-vercel-speed-insights (default 1).