Skip to content

feat(nuxt): forward module options to the client plugin - #126

Merged
feugy merged 3 commits into
mainfrom
feat/nuxt-module-options
Nov 26, 2026
Merged

feugy merged 3 commits into
mainfrom
feat/nuxt-module-options

Conversation

@danielroe

Copy link
Copy Markdown
Contributor

πŸ““ What's in there?

The Nuxt module declares configKey: 'speedInsights' but its setup() never reads the options, so the generated client plugin always calls injectSpeedInsights() with no arguments and this has no effect:

export default defineNuxtConfig({
  modules: ['@vercel/speed-insights'],
  speedInsights: { sampleRate: 0.25 },
})

As far as I can tell, sampleRate (the documented way to reduce cost) and the other serializable props (debug, scriptSrc, endpoint, dsn) can't currently be set without dropping the module and writing a custom plugin.

This forwards the module options into the generated plugin (serialized with JSON.stringify), keeping the zero-config behaviour unchanged. beforeSend is a function, so configuring it still needs a custom plugin.

πŸ§ͺ How to test?

In apps/nuxt/nuxt.config.ts, add speedInsights: { sampleRate: 0.25 } and run pnpm dev. The generated plugin should call injectSpeedInsights({"sampleRate":0.25}).

@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
speed-insights-astro Ready Ready Preview Nov 26, 2026 2:47pm UTC
speed-insights-nextjs Ready Ready Preview Nov 26, 2026 2:47pm UTC
speed-insights-nuxt Ready Ready Preview Nov 26, 2026 2:47pm UTC
speed-insights-remix Ready Ready Preview Nov 26, 2026 2:47pm UTC
speed-insights-sveltekit Ready Ready Preview Nov 26, 2026 2:47pm UTC
speed-insights-sveltekit-old Ready Ready Preview Nov 26, 2026 2:47pm UTC
speed-insights-vue Ready Ready Preview Nov 26, 2026 2:47pm UTC

Request Review

@feugy
feugy enabled auto-merge (squash) November 26, 2026 14:26

This branch was successfully deployed

7 active deployments
Preview – speed-insights-sveltekit-old β€” 18ce4035 Deployed Nov 26, 2026 by vercel[bot]
Preview – speed-insights-astro β€” 18ce4035 Deployed Nov 26, 2026 by vercel[bot]
Preview – speed-insights-vue β€” 18ce4035 Deployed Nov 26, 2026 by vercel[bot]
Preview – speed-insights-nextjs β€” 18ce4035 Deployed Nov 26, 2026 by vercel[bot]
Preview – speed-insights-nuxt β€” 18ce4035 Deployed Nov 26, 2026 by vercel[bot]
Preview – speed-insights-remix β€” 18ce4035 Deployed Nov 26, 2026 by vercel[bot]
Preview – speed-insights-sveltekit β€” 18ce4035 Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants