Skip to content

Commit 7450c2e

Browse files
authored
feat(analytics): use Scarf.js to provide anonymized installation analytics (#5259)
## 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`.
1 parent 0ab248b commit 7450c2e

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SwaggerEditor is using [**forked** Create React App](https://github.com/swagger-
44

55
## Table of Contents
66

7+
- [Anonymized analytics](#anonymized-analytics)
78
- [Getting started](#getting-started)
89
- [Prerequisites](#prerequisites)
910
- [Installation](#installation)
@@ -19,6 +20,23 @@ SwaggerEditor is using [**forked** Create React App](https://github.com/swagger-
1920
- [License](#license)
2021
- [Software Bill Of Materials (SBOM)](#software-bill-of-materials-sbom)
2122

23+
## Anonymized analytics
24+
25+
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`:
26+
27+
```
28+
// package.json
29+
{
30+
// ...
31+
"scarfSettings": {
32+
"enabled": false
33+
}
34+
// ...
35+
}
36+
```
37+
38+
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`.
39+
2240
## Getting started
2341

2442
### Prerequisites

package-lock.json

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"@emotion/styled": "^11.11.5",
6767
"@mui/material": "^5.15.21",
6868
"@primer/octicons-react": "^19.10.0",
69+
"@scarf/scarf": "=1.3.0",
6970
"@swagger-api/apidom-core": ">=1.0.0-alpha.3 <1.0.0-beta.0",
7071
"@swagger-api/apidom-json-pointer": ">=1.0.0-alpha.3 <1.0.0-beta.0",
7172
"@swagger-api/apidom-ls": ">=1.0.0-alpha.3 <1.0.0-beta.0",

0 commit comments

Comments
 (0)