Skip to content

Commit 3e59da4

Browse files
authored
feat(analytics): use Scarf.js to provide anonymized installation analytics (#3707)
Swagger Client 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 `scafeSettings.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 cad4b12 commit 3e59da4

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ Swagger Client Version | Release Date | OpenAPI Spec compatibility |
2828
3.10.x | 2020-01-17 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3 | [tag v3.10.0](https://github.com/swagger-api/swagger-js/tree/v3.10.0)
2929
2.1.32 | 2017-01-12 | 1.0, 1.1, 1.2 | [tag v2.1.32](https://github.com/swagger-api/swagger-js/tree/v2.1.32). This [release](https://github.com/swagger-api/swagger-js/releases/tag/v2.1.32) is only available on GitHub.
3030

31+
## Anonymized analytics
32+
33+
Swagger Client 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 `scafeSettings.enabled` field to `false` in your project's `package.json`:
34+
35+
```
36+
// package.json
37+
{
38+
// ...
39+
"scarfSettings": {
40+
"enabled": false
41+
}
42+
// ...
43+
}
44+
```
45+
46+
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`.
47+
3148
## Documentation
3249

3350
#### Usage

package-lock.json

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

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"license": "Apache-2.0",
7474
"dependencies": {
7575
"@babel/runtime-corejs3": "^7.22.15",
76+
"@scarf/scarf": "=1.3.0",
7677
"@swagger-api/apidom-core": ">=1.0.0-alpha.9 <1.0.0-beta.0",
7778
"@swagger-api/apidom-error": ">=1.0.0-alpha.9 <1.0.0-beta.0",
7879
"@swagger-api/apidom-json-pointer": ">=1.0.0-alpha.9 <1.0.0-beta.0",
@@ -82,13 +83,13 @@
8283
"deepmerge": "~4.3.0",
8384
"fast-json-patch": "^3.0.0-1",
8485
"js-yaml": "^4.1.0",
86+
"neotraverse": "=0.6.18",
8587
"node-abort-controller": "^3.1.1",
8688
"node-fetch-commonjs": "^3.3.2",
8789
"openapi-path-templating": "^1.5.1",
8890
"openapi-server-url-templating": "^1.0.0",
8991
"ramda": "^0.30.1",
90-
"ramda-adjunct": "^5.0.0",
91-
"neotraverse": "=0.6.18"
92+
"ramda-adjunct": "^5.0.0"
9293
},
9394
"devDependencies": {
9495
"@babel/cli": "^7.21.0",

0 commit comments

Comments
 (0)