REACT_DOCTOR_NO_TELEMETRY=1 does not suppress the /api/score upload
Summary
REACT_DOCTOR_NO_TELEMETRY=1 does not suppress the POST to https://www.react.doctor/api/score, although the Data Use page presents it as equivalent to --no-telemetry.
The env var does correctly disable Sentry and Axiom. But the score upload is the payload that carries the most identifying data — the repository owner/name resolved from the git remote, the exact HEAD commit SHA, and every diagnostic's file path — so the incomplete control applies to the highest-value channel.
The --no-telemetry / --no-score flag works correctly and suppresses all three. Only the environment variable is affected.
Version: [email protected] (current latest). Reproduced 2/2 on Linux, Node 24.12.0.
Reproduction
mkdir /tmp/rd-demo && cd /tmp/rd-demo
npm pkg init -y >/dev/null
npm pkg set dependencies.next=15.5.4 dependencies.react=19.2.0 dependencies.react-dom=19.2.0
mkdir -p src
printf "export function C({u}:{u:string}){return <img src={u} />}\n" > src/C.tsx
git init -q .
git add -A && git -c user.email=a@b -c user.name=c commit -qm init
git remote add origin [email protected]:acme/private-app.git # any remote
REACT_DOCTOR_NO_TELEMETRY=1 npx [email protected] -y --json --json-out /tmp/r.jsonObserved: a POST https://www.react.doctor/api/score still goes out (gzip JSON, ~3.5KB).
Expected: no request, matching the documented behaviour of --no-telemetry.
To see it without a proxy, attach a small shim that wraps fetch and run with
NODE_OPTIONS="--import=file:///path/to/shim.mjs":
const orig = globalThis.fetch;
globalThis.fetch = async function (input, init) {
const url = typeof input === 'string' ? input : input?.url;
if (init?.method === 'POST') console.error('[egress]', url);
return orig.apply(this, arguments);
};Decompressing the captured body shows the top-level keys:
repo, sha, framework, reactVersion, sourceFileCount, defaultBranch, doctorVersion, runId,
diagnostics[] — each with filePath / line / column / offset / length / rule / messageRoot cause
Two independent gates, and only one of them reads the environment variable.
packages/react-doctor/src/cli/utils/is-telemetry-enabled.ts honours it, but its own docstring scopes it to Sentry and Axiom:
Whether this process may emit telemetry of any kind — Sentry crash reports and Axiom traces/metrics alike.
if (process.argv.includes("--no-score") || process.argv.includes("--no-telemetry")) return false;
if (isEnvFlagEnabled(process.env.REACT_DOCTOR_NO_TELEMETRY)) return false;packages/react-doctor/src/cli/utils/is-share-opted-out.ts gates the score/share path, and consults only the parsed CLI flag and per-project config — never process.env.REACT_DOCTOR_NO_TELEMETRY:
export const isShareOptedOut = (scans, flagNoScore) =>
Boolean(flagNoScore) ||
scans.some((scan) => Boolean(scan.config?.noScore) || scan.config?.share === false);So the flag reaches both gates, and the env var reaches only the first.
Why this matters beyond the inconsistency
The env var is the control that CI and shared tooling naturally reach for, since it needs no change to an existing command. Anyone who sets it and verifies that Sentry and Axiom went quiet would reasonably conclude they are fully opted out.
Two further notes that may be worth considering alongside the fix:
- The Data Use page states that "Repository names, directory names, and filenames can remain after this process", which is accurate — but it sits next to "The CLI does not send your file contents or code snippets", and readers may take the second sentence as the whole story. The score payload's
repo+shapair in particular identifies a private repository exactly. - A config-file-only opt-out (
noScore/share: false/supplyChain.enabled: false) suppresses the score API and the Socket.dev calls but leaves Sentry and Axiom active, which is the mirror image of the env var's behaviour. Today the only single control that closes everything is the CLI flag. MakingREACT_DOCTOR_NO_TELEMETRYand the config file each sufficient on their own would remove a class of surprise.
Suggested fix
Have the score/share gate consult the same env check, e.g. isShareOptedOut(...) || !isTelemetryEnabled(), or read REACT_DOCTOR_NO_TELEMETRY directly in isShareOptedOut.
Happy to open a PR if that would help.
Source: millionco/react-doctor