Add telemetry sampling for non-Pro users (#2642)
## Summary
- Store Dyad Pro status in localStorage for telemetry access
- Sample 10% of events for non-Pro users (error events always sent)
- Pro users continue to send all events
## Test plan
- Verify telemetry events are sampled correctly for non-Pro users
- Confirm error events are always sent regardless of Pro status
- Test Pro users still send all events
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2642"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds telemetry sampling for non‑Pro users to reduce event volume while
keeping error visibility. Stores Dyad Pro status in localStorage; Pro
users keep sending all events.
- **New Features**
- Save Dyad Pro status in localStorage (dyadProStatus) and expose
isDyadProUser().
- Sample PostHog events for non‑Pro: send 10% of non‑error events;
always send errors.
- No change for Pro users; all events continue to be sent.
<sup>Written for commit 685922c99bc83c6c1d3c6e58a99761037894bc2b.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
Co-authored-by:
Will Chen <willchen90@gmail.com>
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com>
正在显示
请
注册
或者
登录
后发表评论