onekeyhq/app-monorepo/1k-analytics
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
OneKey analytics and server event tracking with LogToServer, logger scopes/scenes, and business metrics. Use for 埋点, analytics, or tracking events.
Install
npx vskill@latest install onekeyhq/app-monorepo/1k-analyticsSKILL.md
Analytics Event Tracking
OneKey uses a decorator-based logger system to track user behavior events. Events are routed to the analytics server (Mixpanel) via @LogToServer() decorator on scene methods. NEVER call analytics.trackEvent() directly.
Quick Reference
| Topic | Guide | Key Files | |
|---|---|---|---|
| Adding events | adding-events.md | packages/shared/src/logger/scopes/ | |
| Architecture | architecture.md | packages/shared/src/logger/base/ | |
| Common pitfalls | pitfalls.md | — |
Critical Rules
- MUST use `@LogToServer()` decorator — never call
analytics.trackEvent()directly - Event method names use camelCase — the method name becomes the event name sent to Mixpanel
- Methods MUST return params synchronously — never return a Promise
- Deduplicate high-frequency events — prevent Mixpanel usage spikes (e.g., use in-memory Set for per-session dedup)
- Add events to existing scopes when possible — only create new scopes for entirely new feature domains
Adding a Server Event (Quick Steps)
1. Create or update a Scene class
2. Register scene in scope index
3. Call from business code
Decorator Types
| Decorator | Destination | Use Case | |
|---|---|---|---|
@LogToServer() | Mixpanel analytics server | User behavior tracking, business metrics | |
@LogToLocal() | Device local log (React Native logger) | Debugging, device-side diagnostics | |
@LogToConsole() | Console only | Dev-time debugging |
Stack decorators for dual logging: @LogToServer() + @LogToLocal().
Related Skills
/1k-architecture— Import hierarchy rules (logger is in@onekeyhq/shared)/1k-coding-patterns— TypeScript and React conventions
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.skillshare/skills/1k-analytics/SKILL.md
Popularity
- Repository stars
- 2,370
- Repository forks
- 516
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/onekeyhq/app-monorepo/1k-analytics)