Back to Char

Add Analytics

.cursor/commands/add-analytics.md

latest712 B
Original Source
  • Scope: apps/desktop/src folder.
  • Usage:
    • import { commands as analyticsCommands } from "@hypr/plugin-analytics";.
    • analyticsCommands.event({ event: "SOMETHING_USING_UNDERSCORE", other_props_a: "1", other_props_b: 2 })
    • analyticsCommands.setProperties({ set: {} })
  • Notes:
    • We use the machine's fingerprint as distinct_id. All other info should be placed as props.
    • When adding .event or .setProperties call, make your best effort to not add complexity to code. It is ideal to place these calls inside the onSuccess callback of things like useMutation.
  • Resources: