The @laioutr/app-vercel-speed-insights package integrates Vercel Speed Insights into a Laioutr-powered Nuxt app. It does not register orchestr handlers. Instead, it adds a client plugin that calls Vercel's Nuxt runtime injection API so real-user performance data is collected on client-side page views.
The package uses @vercel/speed-insights under the hood and passes an optional sample rate from Nuxt public runtime config.
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%
},
});
speed-insights.client.ts) and calls injectSpeedInsights({ sampleRate: config.sampleRate ?? 1 }) from @vercel/speed-insights/nuxt/runtime. This injects Speed Insights in the browser runtime without requiring a page wrapper component.sampleRate is merged into public runtime config under @laioutr/app-vercel-speed-insights, then read by the client plugin.registerLaioutrApp({ name, version }) so the app is discoverable in the Laioutr app ecosystem.This package does not provide orchestr queries, actions, links, or resolvers. It only adds Vercel Speed Insights to the client runtime.
@laioutr/app-vercel-speed-insights (default 1).@vercel/speed-insights to v2.0.0.