From f8dcba0cbb498b3efc3fd745eef9e4cda83815a4 Mon Sep 17 00:00:00 2001 From: Aric Camarata Date: Tue, 30 Jun 2026 15:52:06 -0400 Subject: [PATCH] add opt-in anonymous telemetry (#2) * add opt-in telemetry via @acamarata/telemetry (off by default) * chore: update lockfile for @acamarata/telemetry devDep --- README.md | 5 +++++ TELEMETRY.md | 8 ++++++++ package.json | 3 ++- pnpm-lock.yaml | 9 +++++++++ src/index.ts | 11 +++++++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 TELEMETRY.md diff --git a/README.md b/README.md index d066d34..8a0f097 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,11 @@ Full API reference, dynamic algorithm details, traditional method table, and hig Solar position calculations use [nrel-spa](https://github.com/acamarata/nrel-spa), a port of the NREL SPA by Ibrahim Reda and Afshin Andreas. The seasonal twilight model builds on the work of Khalid Shaukat (Moonsighting Committee Worldwide). +## Telemetry + +This package supports opt-in anonymous usage telemetry — off by default. +Enable: `ACAMARATA_TELEMETRY=1`. See [TELEMETRY.md](./TELEMETRY.md) for what is sent and how to disable. + ## License MIT. Copyright (c) 2023-2026 Aric Camarata. diff --git a/TELEMETRY.md b/TELEMETRY.md new file mode 100644 index 0000000..99cfaa4 --- /dev/null +++ b/TELEMETRY.md @@ -0,0 +1,8 @@ +# Telemetry Disclosure + +This package supports opt-in anonymous usage telemetry via [`@acamarata/telemetry`](https://github.com/acamarata/telemetry). + +Telemetry is **off by default**. No data is sent unless you set `ACAMARATA_TELEMETRY=1`. + +Full disclosure (what is sent, where it goes, how to disable): +[github.com/acamarata/telemetry/blob/main/TELEMETRY.md](https://github.com/acamarata/telemetry/blob/main/TELEMETRY.md) diff --git a/package.json b/package.json index cca3b1a..cb1d881 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,8 @@ "typedoc": "^0.28.19", "typedoc-plugin-markdown": "^4.11.0", "typescript": "^5.9.3", - "typescript-eslint": "^8.56.1" + "typescript-eslint": "^8.56.1", + "@acamarata/telemetry": "^0.1.0" }, "type": "module", "packageManager": "pnpm@10.11.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c3d4469..0720cce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,9 @@ importers: '@acamarata/prettier-config': specifier: ^0.1.0 version: 0.1.0(prettier@3.8.1) + '@acamarata/telemetry': + specifier: ^0.1.0 + version: 0.1.0 '@acamarata/tsconfig': specifier: ^0.1.0 version: 0.1.0 @@ -85,6 +88,10 @@ packages: peerDependencies: prettier: '>=3.0.0' + '@acamarata/telemetry@0.1.0': + resolution: {integrity: sha512-iP09ZD0bHencHLbv6kQZDgwN9crLCWGKxmiMrfJjhBCoWTgv4koSgg0Li/LFKwCCFluua6orj9fVeQ8eqcJXSQ==} + engines: {node: '>=20'} + '@acamarata/tsconfig@0.1.0': resolution: {integrity: sha512-bgzyBak43mE+0HhduZX3cvaPjKcggtGGZZMjr35qtYWolsIWgZ9nx7OOswbVYoU35qoUv6rZ0mTK6GbZ8QTYjw==} engines: {node: '>=20'} @@ -1233,6 +1240,8 @@ snapshots: dependencies: prettier: 3.8.1 + '@acamarata/telemetry@0.1.0': {} + '@acamarata/tsconfig@0.1.0': {} '@bcoe/v8-coverage@1.0.2': {} diff --git a/src/index.ts b/src/index.ts index 8a8b005..f5e0f57 100644 --- a/src/index.ts +++ b/src/index.ts @@ -42,3 +42,14 @@ export type { AtmosphericParams, MethodDefinition, } from "./types.js"; + +// ── Opt-in anonymous telemetry ──────────────────────────────────────────────── +// Off by default. Enable: ACAMARATA_TELEMETRY=1 +// What is sent + how to disable: https://github.com/acamarata/telemetry/blob/main/TELEMETRY.md +import('@acamarata/telemetry') + .then(({ track }) => + track('load', { package: 'pray-calc', version: '2.1.2' }), + ) + .catch(() => { + // telemetry not installed or disabled — that is fine + });