Slice · AI prompt
Framework-neutral analytics instrumentation contract. The host injects an EventTrackingCtx transport for event emit, guarded event queries, and funnel reads; the canonical slice ships no renderer or storage backend.
# Install `event-tracking` — Analytics
> Framework-neutral analytics instrumentation contract.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/event-tracking
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=event-tracking
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/event-tracking
## 1. Install
```bash
npx rahman-resources add event-tracking
# alias: npx rr add event-tracking
```
The CLI copies `frontend/slices/event-tracking/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 3. Wire it up
Run `npx rr add event-tracking` (React/default) or `npx rr add event-tracking --framework sveltekit`. Bind EventTrackingCtx.track/query/funnel to your analytics transport; enforce authorization on query/funnel at the server boundary. The slice intentionally does not invent a UI or persistence backend.
## Rules of engagement
- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice
The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.