Skip to content

Commit

Permalink
feat(analytics): use Scarf.js to provide anonymized installation anal…
Browse files Browse the repository at this point in the history
…ytics (#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`.
  • Loading branch information
char0n authored Nov 6, 2024
1 parent 0ab248b commit 7450c2e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SwaggerEditor is using [**forked** Create React App](https://github.com/swagger-

## Table of Contents

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

## 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`.

## Getting started

### Prerequisites
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@emotion/styled": "^11.11.5",
"@mui/material": "^5.15.21",
"@primer/octicons-react": "^19.10.0",
"@scarf/scarf": "=1.3.0",
"@swagger-api/apidom-core": ">=1.0.0-alpha.3 <1.0.0-beta.0",
"@swagger-api/apidom-json-pointer": ">=1.0.0-alpha.3 <1.0.0-beta.0",
"@swagger-api/apidom-ls": ">=1.0.0-alpha.3 <1.0.0-beta.0",
Expand Down

0 comments on commit 7450c2e

Please sign in to comment.