Skip to content

feat(nuxt)!: Add support for injectSpeedInsights() and Nuxt module#110

Merged
feugy merged 7 commits intocanaryfrom
feat/nuxt-as-a-module
Dec 23, 2025
Merged

feat(nuxt)!: Add support for injectSpeedInsights() and Nuxt module#110
feugy merged 7 commits intocanaryfrom
feat/nuxt-as-a-module

Conversation

@HugoRCD
Copy link
Copy Markdown
Member

@HugoRCD HugoRCD commented Dec 11, 2025

This PR restructures the Nuxt module to provide a cleaner developer experience.

One-line usage

For Nuxt users wanting to enable Vercel Speed Insights without the need to configure anything:

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@vercel/speed-insights']
})

Custom usage

If the user needs to specify options, they can use the injectSpeedInsights function in a Nuxt plugin:

// app/plugins/speed-insights.ts
import { injectSpeedInsights } from "@vercel/speed-insights/nuxt/runtime"

export default defineNuxtPlugin(() => {
  injectSpeedInsights({
    beforeSend(event) {
      if (event.url.includes('/private')) {
        return null;
      }
      return event
    }
  })
})

Component usage

Using the <SpeedInsights> component is still supported but should not be recommended as it needs to be set in both app.vue and error.vue.

@HugoRCD HugoRCD self-assigned this Dec 11, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 11, 2025

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

Project Deployment Review Updated (UTC)
speed-insights-astro Ready Ready Preview, Comment Dec 22, 2025 5:31pm
speed-insights-nextjs Ready Ready Preview, Comment Dec 22, 2025 5:31pm
speed-insights-nuxt Ready Ready Preview, Comment Dec 22, 2025 5:31pm
speed-insights-remix Ready Ready Preview, Comment Dec 22, 2025 5:31pm
speed-insights-sveltekit Ready Ready Preview, Comment Dec 22, 2025 5:31pm
speed-insights-vue Ready Ready Preview, Comment Dec 22, 2025 5:31pm

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Dec 11, 2025

@HugoRCD HugoRCD requested a review from atinux December 11, 2025 15:36
Comment thread packages/web/package.json Outdated
@atinux atinux changed the title feat(nuxt): Add support for injectSpeedInsights() and Nuxt module feat(nuxt)!: Add support for injectSpeedInsights() and Nuxt module Dec 11, 2025
Comment thread packages/web/package.json Outdated
Co-authored-by: Sébastien Chopin <atinux@gmail.com>
Co-authored-by: Sébastien Chopin <atinux@gmail.com>
Copy link
Copy Markdown
Member

@feugy feugy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merry Christmas!!

@feugy feugy merged commit 1d4f203 into canary Dec 23, 2025
10 checks passed
@feugy feugy deleted the feat/nuxt-as-a-module branch December 23, 2025 09:28
@feugy feugy mentioned this pull request Mar 10, 2026
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