{"id":19122655,"url":"https://github.com/vulcanjs/meteor-events","last_synced_at":"2025-05-05T18:01:41.687Z","repository":{"id":29191059,"uuid":"32722138","full_name":"VulcanJS/meteor-events","owner":"VulcanJS","description":"Internal event tracking for Meteor apps","archived":false,"fork":false,"pushed_at":"2015-04-04T02:33:51.000Z","size":146,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T22:41:52.560Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VulcanJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-23T09:23:05.000Z","updated_at":"2019-09-12T21:36:33.000Z","dependencies_parsed_at":"2022-08-17T19:40:45.441Z","dependency_job_id":null,"html_url":"https://github.com/VulcanJS/meteor-events","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VulcanJS%2Fmeteor-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VulcanJS%2Fmeteor-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VulcanJS%2Fmeteor-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VulcanJS%2Fmeteor-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VulcanJS","download_url":"https://codeload.github.com/VulcanJS/meteor-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249593381,"owners_count":21296717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T05:22:27.623Z","updated_at":"2025-04-19T02:32:49.232Z","avatar_url":"https://github.com/VulcanJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# meteor-events\n\nInternal event tracking for Meteor apps\n\n**(Note: this package doesn't actually exist yet. This is just the specs/documentation)**\n\n### About\n\n`meteor-events` lets you easily track events in your Meteor app, storing them in an `Events.collection` collection. \n\nThis is different from libraries such as [analytics.js](http://segmentio.github.io/analytics.js/), which send your events to a third-party service. \n\n`meteor-events`'s purpose is to centralize your events and send them to your own database, so you can use them in your app (for example, to count how many times a user has done an action). \n\nOf course, you can then easily add a callback to *also* propagate the events you track to services like Mixpanel or Google Analytics. \n\n### Install\n\n`meteor add telescope:events`\n\n### Events\n\nEvents have the following properties:\n\n- `createdAt` (`Date`): When the event happened. Defaults to the current timestamp.\n- `name` (`String`): The event's name.\n- `description` (`String`) [optional]: A description of the event.\n- `unique` (`Boolean`) [optional]: Whether the event is unique. Unique events can only be logged once. Defaults to `false`. \n- `uniquePerUser` (`Boolean`) [optional]:  Whether the event is unique *per user*. Unique events can only be logged once per user. Defaults to `false`. \n- `important` (`Boolean`) [optional]: Whether the event is important. Important events are never deleted. Defaults to `false`.\n- `log` (`Boolean`): Whether to log the event in the database. Defaults to `true`. \n- `type` (`String`): `client` or `server`. \n- `userId` (`String`) [optional]: The `_id` of the user triggering the event, if available. Required if `uniquePerUser` is `true`. \n- `properties` (`Object`) [optional]: The event's properties. \n\nOn the client, `userId` will default to `Meteor.userId()`. On the server, it needs to be specified. \n\n### Methods\n\n- `Events.track()` (Client/Server): tracks an event. \n- `Events.purge()` (Server): deletes all events from the database, except those marked as `important`. \n\n### Callbacks\n\n- `Events.onTrack(function (event) {...})`: declare a callback to execute whenever an event is tracked. \n\n### Plugins\n\nPlugins can let you transparently extend the package with different analytics solutions. For example adding `events-ga` would propagate events to Google Analytics, `events-segmentio` would add Segment.io, and so on. \n\n### Example\n\n```js\nEvents.track({\n  name: 'signedUp',\n  uniquePerUser: true,\n  userId: Meteor.user(),\n  properties: {\n    plan: 'Premium', \n    ip: '123.456.789.123'\n  }\n})\n```\n\n### Other Resources\n\n- https://github.com/keen/common-web\n- https://segment.com/libraries/analytics.js/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvulcanjs%2Fmeteor-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvulcanjs%2Fmeteor-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvulcanjs%2Fmeteor-events/lists"}