Files
create-better-t-stack/apps/web/content/docs/analytics.mdx
2025-08-08 17:35:12 +05:30

72 lines
2.3 KiB
Plaintext

---
title: Analytics & Telemetry
description: What we collect, how to disable it, and where to view aggregated insights
---
## What is collected
On successful project creation, the CLI sends a single event (`project_created`) with:
- Selected options (stack choices): `frontend`, `backend`, `runtime`, `database`, `orm`, `api`, `auth`, `addons`, `examples`, `dbSetup`, `webDeploy`, `packageManager`
- Environment data: `cli_version`, `node_version`, `platform`
- A random session id: `distinct_id` like `cli_<random>`
- IP removed: `$ip: null`
Not collected:
- Project name, path, or file contents (explicitly omitted)
- Secrets or environment variables from your machine
## Disable telemetry
Telemetry is enabled by default. To disable:
<Tabs items={['bun', 'pnpm', 'npm']}>
<Tab value="bun">
```bash
# Disable for a single run
BTS_TELEMETRY_DISABLED=1 bun create better-t-stack@latest
```
</Tab>
<Tab value="pnpm">
```bash
# Disable for a single run
BTS_TELEMETRY_DISABLED=1 pnpm create better-t-stack@latest
```
</Tab>
<Tab value="npm">
```bash
# Disable for a single run
BTS_TELEMETRY_DISABLED=1 npx create-better-t-stack@latest
```
</Tab>
</Tabs>
Add `export BTS_TELEMETRY_DISABLED=1` to your shell profile to make it permanent.
## Where to view analytics
- Charts: [`/analytics`](/analytics)
- Raw JSON snapshot: `https://r2.amanv.dev/analytics-data.json`
- CSV export: `https://r2.amanv.dev/export.csv`
Notes:
- Aggregates are periodically regenerated from incoming events
- Raw data is not publicly exposed; the `/analytics` page presents only summary statistics
## Full transparency
Single event per scaffold; randomized id; no IP or project identifiers. See source code below.
If in doubt, set `BTS_TELEMETRY_DISABLED=1` and proceed. You can still use all CLI features.
## Source code
- CLI event sender: [`apps/cli/src/utils/analytics.ts`](https://github.com/AmanVarshney01/create-better-t-stack/blob/main/apps/cli/src/utils/analytics.ts)
- Telemetry toggle logic: [`apps/cli/src/utils/telemetry.ts`](https://github.com/AmanVarshney01/create-better-t-stack/blob/main/apps/cli/src/utils/telemetry.ts)
- Aggregation script (builds the charts data): [`apps/web/scripts/generate-analytics.ts`](https://github.com/AmanVarshney01/create-better-t-stack/blob/main/apps/web/scripts/generate-analytics.ts)