Welcome to Blogvent, day 15!
Next.js, through its CLI, collects anonymous telemetry data about general usage by default. The data collected includes:
- CLI command invoked (
next build
,next dev
, ornext export
) - The version of Next.js you’re using
- Your operating system
- Next.js plugins used in your project
- Duration of
next build
and size of application
This information doesn’t identify you in any way, but you might not want it to be collected. To disable this data collection, run this command at the root of your project:
npx next telemetry disable
# to re-enable, turn "disable" into "enable"
Similarly, you can check the status of telemetry data collection with this command:
npx next telemetry status
If you want to ensure this is a change in your codebase, you can also set an environment variable (here’s more details how!) in your project:
NEXT_TELEMETRY_DISABLED=1
I want to start a new project!
Who doesn’t? Here’s a starter application to to try this out:
(Clicking this button will deploy a Next.js starter project to Netlify, and clone it to your chosen Git provider)
Top comments (2)
It's worth noting that Next.js telemetry opt-out in Docker and CI environments is ephemeral by design. Your best bet is to assume that Next.js analytics will be enabled somewhere in your workflow despite your best efforts to disable it. If you can't live with that, either fork Next.js or try something else, such as Astro, Remix, or even SvelteKit.
Add
"postinstall": "pnpm next telemetry disable"
in package.json.Works flawless for me.