Skip to content

Commit

Permalink
Merge pull request #67 from scarf-sh/ISSUE-53-Do-not-track
Browse files Browse the repository at this point in the history
[ISSUE-53] DO_NOT_TRACK
  • Loading branch information
nshipman-io authored Aug 22, 2023
2 parents ba916b8 + 5a5273d commit ca75494
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ Alternatively, you can set this variable in your environment:
export SCARF_ANALYTICS=false
```

You can also set this variable in accordance to the [Console Do Not Track](https://consoledonottrack.com/) standard:
```shell
export DO_NOT_TRACK=1
```

Either route will disable Scarf for all packages.

#### I distribute a package on npm, and scarf-js is in our dependency tree. Can I disable the analytics for my downstream dependents?
Expand Down
2 changes: 1 addition & 1 deletion report.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function logIfVerbose (toLog, stream) {
// SCARF_NO_ANALYTICS was the original variable, we'll get rid of it eventually
const userHasOptedOut = (rootPackage) => {
return (rootPackage && rootPackage.scarfSettings && rootPackage.scarfSettings.enabled === false) ||
(process.env.SCARF_ANALYTICS === 'false' || process.env.SCARF_NO_ANALYTICS === 'true')
(process.env.SCARF_ANALYTICS === 'false' || process.env.SCARF_NO_ANALYTICS === 'true' || process.env.DO_NOT_TRACK === '1')
}

const userHasOptedIn = (rootPackage) => {
Expand Down

0 comments on commit ca75494

Please sign in to comment.