--- title: "Next.js" description: "Step-by-step guide to adding Pulse privacy-first analytics to your Next.js app with next/script. Covers App Router and Pages Router." category: "framework" brandColor: "#000000" officialUrl: "https://nextjs.org/docs" relatedIds: ["react", "vercel", "nuxt"] date: "2026-03-28" --- The best way to add Pulse to your Next.js application is using the built-in `next/script` component. --- ## Method 1: App Router Add the Pulse script to your root layout so it loads on every page. {`import Script from 'next/script' export default function RootLayout({ children, }: { children: React.ReactNode }) { return (