From abb942c23e11bea1296f8b9a97c5d24a6aa37c7e Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Wed, 6 Nov 2024 10:40:08 +0100 Subject: [PATCH 1/2] feat: use Scarf.js to provide anonymized installation analytics --- README.md | 17 +++++++++++++++++ package-lock.json | 15 +-------------- package.json | 1 + swagger-editor-dist-package/README.md | 19 +++++++++++++++++++ swagger-editor-dist-package/package.json | 4 +++- 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index fc7fc7c6641..4306915c47d 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,23 @@ This repository publishes to two different NPM modules: If you're building a single-page application, using `swagger-editor` is strongly recommended, since `swagger-editor-dist` is significantly larger. +## Anonymized analytics + +Swagger Editor uses [Scarf](https://scarf.sh/) to collect [anonymized installation analytics](https://github.com/scarf-sh/scarf-js?tab=readme-ov-file#as-a-user-of-a-package-using-scarf-js-what-information-does-scarf-js-send-about-me). These analytics help support the maintainers of this library and ONLY run during installation. To [opt out](https://github.com/scarf-sh/scarf-js?tab=readme-ov-file#as-a-user-of-a-package-using-scarf-js-how-can-i-opt-out-of-analytics), you can set the `scarfSettings.enabled` field to `false` in your project's `package.json`: + +``` +// package.json +{ + // ... + "scarfSettings": { + "enabled": false + } + // ... +} +``` + +Alternatively, you can set the environment variable `SCARF_ANALYTICS` to `false` as part of the environment that installs your npm packages, e.g., `SCARF_ANALYTICS=false npm install`. + ## Helpful scripts Any of the scripts below can be run by typing `npm run