Skip to main content

analytics

Read when adding or changing product analytics events. Import track from @shared/analytics and React adapters from @shared/analytics-react.

来源信息

仓库
LedgerHQ/ledger-live
最近来源活动
2026年10月7日 16:51
检测到的 SKILL.md 语言
英语
星标
622
分支
491

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
analytics
description
Read when adding or changing product analytics events. Import track from @shared/analytics and React adapters from @shared/analytics-react.
# Product analytics The API is [`@shared/analytics`](../../../shared/analytics/README.md). React adapters are [`@shared/analytics-react`](../../../shared/analytics-react/README.md). - Import `track` and `trackPage` from `@shared/analytics` and `Track`, `TrackPage`, and `TrackScreen` from `@shared/analytics-react`. - Do not re-export `track`, `trackPage`, `Track`, `TrackPage` or `TrackScreen` from app modules. App `segment.ts` files only wire the host. - Register the Segment client, consent, `identify`, extra props, and props filters in app (currently `/apps/**/segment.ts`). - Flow packages may keep an injected `track` helper so tests can pass a fake. They must not import an app barrel. - In tests, mock `@shared/analytics` (and `@shared/analytics-react` when the component is under test). - Do not put PII in event payloads. See [detect-data-leaks](../detect-data-leaks/SKILL.md) and [client-ids](../client-ids/SKILL.md). Portfolio charts (`@ledgerhq/wallet-analytics`) are a different package. Consent models stay in their own READMEs; apps only wire them into `setEnabledFn` and `updateIdentify`.
在 GitHub 查看