Skip to content

feat: add @scarf/scarf install analytics - #849

Closed
nelson-parente wants to merge 1 commit into
mainfrom
scarf-install-analytics
Closed

feat: add @scarf/scarf install analytics#849
nelson-parente wants to merge 1 commit into
mainfrom
scarf-install-analytics

Conversation

@nelson-parente

@nelson-parente nelson-parente commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Description

Proposal: add @scarf/scarf install-time analytics to @dapr/dapr.

Why: npm exposes only aggregate download counts, so the project has no visibility into SDK adoption. Dapr already uses Scarf for analytics elsewhere — the docs.dapr.io footer pixel, Maven Central download stats for the Java SDK, and Scarf.sh is listed as a community-managed tool in COMMUNITY-MANAGER.md. This extends the same visibility to the JS SDK. Related: dapr/cli#1689 routes CLI install-script downloads through a Scarf gateway.

What it does:

  • Runs only as a postinstall hook when @dapr/dapr is installed as a dependency of another project — no runtime footprint, nothing imported at runtime.
  • Reports operating system and package name/version. Scarf uses the request IP for company-level aggregation and does not store it (scarf-js docs).
  • allowTopLevel: false — contributors running npm install inside a js-sdk checkout are not reported.
  • Opt-outs honored: SCARF_ANALYTICS=false, the DO_NOT_TRACK=1 standard, "scarfSettings": { "enabled": false } in the consumer's package.json, or installing with --ignore-scripts.
  • The README gains an "Installation Analytics" disclosure section with opt-out instructions.

Adds scarf-js as a postinstall-only dependency to give Dapr maintainers
anonymized SDK install counts (OS, package version; request IP is used
by Scarf for company-level aggregation and not stored).

- allowTopLevel: false — installs inside a js-sdk checkout are not reported
- Opt-outs honored: SCARF_ANALYTICS=false, DO_NOT_TRACK=1, consumer
  scarfSettings.enabled=false, or --ignore-scripts
- README gains an Installation Analytics disclosure section

Signed-off-by: nelson.parente <nelson_parente@live.com.pt>
@nelson-parente
nelson-parente marked this pull request as ready for review August 17, 2026 08:56
@nelson-parente
nelson-parente requested review from a team as code owners August 17, 2026 08:56
@nelson-parente nelson-parente changed the title feat: add @scarf/scarf install analytics with opt-out (proposal) feat: add @scarf/scarf install analytics Aug 17, 2026
@nelson-parente

Copy link
Copy Markdown
Contributor Author

closing ... @WhitWaldo flagged that npm 12 (Jul 2026) blocks dependency install scripts by default, which kills scarf-js's mechanism

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant