title: Next.js: How to disable telemetry permanently in all environments?
body: <p>I want to disable Next.js telemetry in all environments, forever (Just because, Ok?  Let's not sidetrack the question with irrelevant debate).</p>
  <p>I don't want the telemetry to run on developer environments, test builds, CI builds or anywhere else.
  I'm trying to find a &quot;code&quot; solution - I don't want to have to do anything manually in an environment in order to switch off telemetry.</p>
  <p>Next.js makes it difficult to figure out if telemetry is enabled because it only prints the telemetry warning once on a given machine.</p>
  <p>My diagnostic for knowing if telemetry is running is to add the <code>next telemetry status</code> command to my <code>build</code> script in <code>package.json</code>:</p>
  <pre><code>&quot;build&quot;: &quot;next telemetry status &amp;&amp; next build&quot;,
  </code></pre>
  <p>I've tried adding the following to <code>next.config.js</code>:</p>
  <pre><code>module.exports = {
    env: {
      NEXT_TELEMETRY_DISABLED: '1',
    },
  }
  </code></pre>
  <p>And I've tried adding this to <code>.env</code>:</p>
  <pre><code>NEXT_TELEMETRY_DISABLED=1
  </code></pre>
  <p>But the telemetry command still reports <code>Status: Enabled</code></p>
  <p>In fact, the <code>NEXT_TELEMETRY_DISABLED</code> env variable doesn't seem to work at all, I tried manually disabling telemetry in my IDE by setting the env variable, but it still reports telemetry is enabled:</p>
  <p><a href="https://i.stack.imgur.com/sF8je.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sF8je.png" alt="enter image description here" /></a></p>
  <ul>
  <li>Next.js version: 9.5.2</li>
  <li>Doco: <a href="https://nextjs.org/telemetry" rel="nofollow noreferrer">https://nextjs.org/telemetry</a></li>
  <li>Github issue: <a href="https://github.com/vercel/next.js/issues/8851" rel="nofollow noreferrer">https://github.com/vercel/next.js/issues/8851</a></li>
  </ul>