INTELLIGENCE DEPLOYMENT:
VERCEL SPEED INSIGHTS
OBJECTIVE: This guide outlines the protocol for implementing Vercel Speed Insights. This intelligence framework enables real-time performance tracking, identifying latency bottlenecks and engagement metrics essential for tactical optimization.
> METRICS: LCP | FID | CLS | INP
> DEPLOYMENT: GLOBAL_EDGE
> STATUS: INITIALIZATION_READY
MANDATORY SYSTEMS:
- Vercel Account: Required for deployment. Sign up for free.
- Vercel Project: Required for configuration. Create a new project.
- Vercel CLI: Required for local operations. Install using your package manager of choice:
pnpm i vercelyarn i vercelnpm i vercelbun i vercel
ACTIVATION SEQUENCE:
- Navigate to your Vercel dashboard
- Select your Project
- Click the Speed Insights tab
- Select Enable from the dialog
/_vercel/speed-insights/*) after your next deployment.
PACKAGE INJECTION:
Using the package manager of your choice, add the @vercel/speed-insights package to
your project:
pnpm i @vercel/speed-insightsyarn i @vercel/speed-insightsnpm i @vercel/speed-insightsbun i @vercel/speed-insights
@vercel/speed-insights package.
â—† NEXT.JS (PAGES ROUTER)
Add the SpeedInsights component to your main app file:
import type { AppProps } from 'next/app';
import { SpeedInsights } from '@vercel/speed-insights/next';
function MyApp({ Component, pageProps }: AppProps) {
return (
<>
<Component {...pageProps} />
<SpeedInsights />
</>
);
}
export default MyApp;
â—† NEXT.JS (APP ROUTER)
Add the component to your root layout:
import { SpeedInsights } from "@vercel/speed-insights/next";
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>
{children}
<SpeedInsights />
</body>
</html>
);
}
â—† CREATE-REACT-APP
Add the component to the main app file:
import { SpeedInsights } from '@vercel/speed-insights/react';
export default function App() {
return (
<div>
{/* ... */}
<SpeedInsights />
</div>
);
}
â—† REMIX
Add the component to your root file:
import { SpeedInsights } from '@vercel/speed-insights/remix';
export default function App() {
return (
<html lang="en">
<body>
{/* ... */}
<SpeedInsights />
</body>
</html>
);
}
â—† SVELTEKIT
Call the injection function in your layout:
import { injectSpeedInsights } from "@vercel/speed-insights/sveltekit";
injectSpeedInsights();
â—† VUE / NUXT
Add the component to your template:
<script setup lang="ts">
import { SpeedInsights } from '@vercel/speed-insights/vue';
</script>
<template>
<SpeedInsights />
</template>
â—† OTHER FRAMEWORKS
Import and call the injection function in your main app file:
import { injectSpeedInsights } from "@vercel/speed-insights";
injectSpeedInsights();
â—† HTML
Add the following scripts before the closing </body> tag:
<script>
window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };
</script>
<script defer src="/_vercel/speed-insights/script.js"></script>
DEPLOYMENT METHODS:
Option 1: Direct Deployment
Deploy your app to Vercel's global CDN by running:
vercel deploy
Option 2: Git Repository Integration
Connect your project's git repository to enable automatic deployments on push and merge to main.
/_vercel/speed-insights/script.js script should be visible in the body tag of
your page.
DATA COLLECTION:
- Navigate to your Vercel dashboard
- Select your project
- Click the Speed Insights tab
- After a few days of visitors, explore your performance metrics
> FREQUENCY: REAL_TIME
> METRICS_AVAILABLE: YES
LEARNING RESOURCES:
- Learn how to use the @vercel/speed-insights package
- Learn about performance metrics
- Read about privacy and compliance
- Explore pricing and limits
- Troubleshooting guide
Learn more about how Vercel supports privacy and data compliance standards with Vercel Speed Insights.