Forcibly disable sending Nuxt.js telemetry
Forcibly opt-out of sending any telemetry about your Nuxt.js project
Since v2.13 Nuxt.js includes a telemetry module which reports anonymized data about your usage.
You can have multiple reasons why you want to make sure you dont share any info, for example
Whatever reason you have, if you want to make as sure as possible that you are not sending any telemetry then you can use this module
Probably not.
The Nuxt.js core-team takes privacy already very seriously, this is shown because f.e. we ask users to explicitly opt-in instead of requiring users to opt-out. We explicitly choose to make it as easy as possible for users to opt-out of sending telemetry.
We are fully aware of any privacy issues that may arise from embedding telemetry. Including telemetry is somewhat of a necessary evil, we simply can’t deny that to spent our time most efficiently we need to know how people are using Nuxt.js. Otherwise we risk spending weeks of our time developping a new feature which will then only be used by a small fraction of all Nuxt.js users.
So we kindly ask you to enable telemetry whenever possible. Having you send us anonymous telemetry helps us greatly with knowing which parts of Nuxt.js deserves the most attention. Also because it gives us some assurance that we are also collecting feedback from people who are not active on Github or Discord.
See the @nuxt/telemetry readme for more information
Bugs exists, also in Nuxt.js. Although every bug can be fixed, that could still mean that telemetry have been sent in the mean time.
This package could be used (and should only be used) in cases were that is a concern
Do not trust this package to work flawlessly. Also make sure to set
telemetry: false
in your nuxt.config to tell nuxt/telemetry you want to opt-out
Only works when you are using yarn as package manager and could still sent telemetry if you use npm by mistake
If you only use yarn you can add a resolution entry in your package.json:
// package.json
resolutions: {
"@nuxt/telemetry": "npm:nuxt-optout"
}
The telemetry in Nuxt.js are injected into your project as a nuxt module.
Due to how modules work in Nuxt, this package should preferably be run before Nuxt.js is started. You can do this by either:
export default async function() {
await nuxtOptout()
return {
mode: ‘universal’,
…
}
}
- adding `pre` lifecycle events to your _package.json_
```json
// package.json
...
scripts: {
"predev": "nuxt-optout",
"prebuild": "nuxt-optout",
"prestart": "nuxt-optout",
"dev": "nuxt src",
"build": "nuxt build src",
"start": "nuxt start src",
}
nuxt(-ts)?-optout
instead of nuxt(-ts)?
// package.json
...
scripts: {
"dev": "nuxt-optout src",
"build": "nuxt-optout build src",
"start": "nuxt-optout start src",
// or
"dev": "nuxt-ts-optout src",
}
This package then does three things:
@nuxt/telemetry/package.json
to @nuxt/telemetry/package.disabled.json
so getPKG will return false main
entrypoint of the @nuxt/telemetry module with a noop functionNUXT_TELEMETRY_DISABLED=true
NUXT_TELEMETRY_ENDPOINT='http://127.0.0.1'
To be totally honest, I can’t as also this package could contain bugs.
As mentioned, despite using this package you should still tell nuxt/telemetry you want to opt-out by setting telemetry: false
in your nuxt.config
Note that this solution is often not portable between computers and/or networks
The telemetry are send to https://telemetry.nuxtjs.com. You can add this domain to eg your host file or PiHole blocklist and have it point to localhost instead.