Next.js - CLI telemetry Command



The `telemetry` command in Next.js is used to control the telemetry data collected by the framework during application development. The data collected helps the Next.js team improve the framework. In this chapter, you will learn what is telemetry data, options of `telemetry` command, and how control sharing of the data.

What are Telemetry Data?

Telemetry data is anonymous user data collected by Next.js about general usage to improve Next.js framework in future versions. Following are list of data thats being collected.

  • General machine information (e.g. number of CPUs, macOS /Windows /Linux)
  • Next.js plugins are present in your project
  • Time taken to build the application and size of application (total number of pages)
  • Commands invoked (next build, next dev, or next export)
  • Version of Next.js using.

Next.js Telemetry Command Syntax

Following is the syntax of the `telemetry` command in Next.js CLI:

npx next telemetry [options]

For example, npx next telemetry --enable will enable sharing of telemetry data with Next.js

Options of Telemetry Command

Following are the options available for the `telemetry` command:

Options Explanation
-h, --help Show all available options.
--enable Enables Next.js' telemetry collection.
--disable Disables Next.js' telemetry collection.

Disable Sharing Telemetry Data in Next.js

In Next.js, you can disable the telemetry collection to prevent sharing any usage data with the Next.js team. This can be done using the `--disable` option with the `telemetry` command. The following command will turn off telemetry data collection.

npx next telemetry --disable

Output

The output is confirming that telemetry has been turned off.

Telemetry disable
Advertisements