How to Stop Your Next.js App From Sending Telemetry Data to Vercel
A little-known fact about Next.js is that the framework collects telemetry data about certain performance metrics that Vercel (the company behind Next.js) uses to learn more about the framework’s performance and usage.
From the Next.js documentation.
Telemetry allows us to accurately gauge Next.js feature usage, pain points, and customization across all users.
This data will let us better tailor Next.js to the masses, ensuring its continued growth, relevance, and best-in-class developer experience.
Furthermore, this will allow us to verify if improvements made to the framework are improving the baseline of all applications.
What data is sent to Vercel:
Vercel tracks general usage information, such as plugin use and build performance. Specifically, Vercel tracks:
- Invoked Commands (e. g.
next build
) - Your version of Next.js
- Your machine information
- Used plugins for your project
- Duration of builds
- Application size
According to Vercel, all data is anonymized and Vercel will not collect sensitive data such as secrets.
The data collection, however, is opt-out and not opt-in. As a consequence, many developers are unaware that they are broadcasting usage information in the background.
🚧 As a user of NextJS, I would love to see the telemetry information displayed more prominently in the docs. As is, they are quite hard to find (I chellance you to find a link to them in the docs).
Why is this important?
Sending out telemetry data can be important for a range of reasons. The first one is a general interest in your privacy.
In case your company develops build tooling on top of Next.js this could very well mean that you have to list Vercel as a data processor in your Privacy Policy.
How to disable the collection of telemetry data for your project
To disable the collection of telemetry data, run the following command in the root directory of your Next.js project:
npx next telemetry disable
You can also see whether data-collection is enabled by running:
npx next telemetry status
If you’re building your Next.js project in a CI/CD pipeline you can also opt-out of data collection by setting an environment variable:
NEXT_TELEMETRY_DISABLED=1
To see how to set the environment in a docker file, you can find an example here.
Conclusion
Whether or not you’re ok with Vercel collecting telemetry data in the background is up to you. The objective of the post is to create awareness about the collection of telemetry data when using Next.js.
If you liked this post, please consider clapping for it, as it helps others find it.
Plug 🔌
Are you designing REST(ish) APIs or write technical specs? I’ve built a free api design tool. Visit api-fiddle.com to check it out!