{"id":23111812,"url":"https://github.com/dext7r/tracker","last_synced_at":"2025-07-06T12:08:29.104Z","repository":{"id":208979669,"uuid":"722966546","full_name":"dext7r/tracker","owner":"dext7r","description":"A tracking library for web applications","archived":false,"fork":false,"pushed_at":"2024-06-09T15:59:02.000Z","size":85,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-08T22:03:54.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://dext7r.github.io/tracker/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dext7r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-24T11:14:35.000Z","updated_at":"2024-06-18T13:57:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"b41515d7-590d-405b-97f1-dc7141e70e3a","html_url":"https://github.com/dext7r/tracker","commit_stats":null,"previous_names":["dext7r/tracker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dext7r/tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dext7r%2Ftracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dext7r%2Ftracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dext7r%2Ftracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dext7r%2Ftracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dext7r","download_url":"https://codeload.github.com/dext7r/tracker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dext7r%2Ftracker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263898013,"owners_count":23526835,"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-12-17T02:10:48.337Z","updated_at":"2025-07-06T12:08:29.088Z","avatar_url":"https://github.com/dext7r.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tracker\r\n\r\nTracker is a JavaScript library for tracking various events on a web page, such as mouse events, history events, hash changes, DOM events, and JavaScript errors.\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n\r\n[![ci](https://github.com/dext7r/tracker/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/dext7r/tracker/actions/workflows/ci.yml)\r\n[![license](https://img.shields.io/github/license/dext7r/tracker.svg)](https://github.com/dext7r/tracker/blob/master/LICENSE#L1)\r\n[![version](https://img.shields.io/npm/v/@dext7r/tracker)](https://github.com/dext7r/tracker)\r\n[![language](https://img.shields.io/github/languages/top/dext7r/tracker)](https://github.com/dext7r/tracker/search?l=css)\r\n[![last](https://img.shields.io/github/last-commit/dext7r/tracker.svg)](https://github.com/dext7r/tracker/commits)\r\n[![stars](https://img.shields.io/badge/Hosted-Vercel-brightgreen?style=flat\u0026logo=Vercel)](https://amis.vercel.app/)\r\n\r\n\u003c/div\u003e\r\n\r\n## Table of Contents\r\n\r\n- [Installation](#installation)\r\n- [Usage](#usage)\r\n- [Configuration](#configuration)\r\n- [Examples](#examples)\r\n- [Contributing](#contributing)\r\n- [License](#license)\r\n\r\n## Installation\r\n\r\nInstall the library using npm:\r\n\r\n```bash\r\nnpm install @dext7r/tracker\r\n```\r\n\r\n## Usage\r\n\r\n```JavaScript\r\nimport Tracker from '@dext7r/tracker';\r\n\r\n// Initialize the Tracker with options\r\nconst tracker = new Tracker({\r\n  requestUrl: 'https://nestjs.h7ml.cn//system/track',\r\n  historyTracker: true,\r\n  hashTracker: true,\r\n  domTracker: true,\r\n  jsError: true,\r\n  // Add more configuration options as needed\r\n});\r\n\r\n// Set user ID and extra information\r\ntracker.setUserId('user123');\r\ntracker.setExtra({ plan: 'premium', source: 'website' });\r\n\r\n// Send custom tracking data\r\ntracker.sendTracker({\r\n  event: 'customEvent',\r\n  targetKey: 'buttonClick',\r\n  // Add more data as needed\r\n});\r\n```\r\n\r\n## Configuration\r\n\r\nThe `Tracker` class accepts various configuration options:\r\n\r\n- `requestUrl`: The API endpoint to send tracking data.\r\n- `historyTracker`: Enable or disable tracking of history events.\r\n- `hashTracker`: Enable or disable tracking of hash changes.\r\n- `domTracker`: Enable or disable DOM element tracking.\r\n- `jsError`: Enable or disable tracking of JavaScript errors.\r\n- `sdkVersion`: The version of the Tracker SDK.\r\n- `extra`: Additional information to include in tracking data.\r\n\r\n## Examples\r\n\r\n```JavaScript\r\n// Initialize Tracker with minimal configuration\r\nconst tracker = new Tracker({ requestUrl: 'https://nestjs.h7ml.cn//system/track' });\r\n\r\n// Set user ID\r\ntracker.setUserId('user123');\r\n\r\n// Set extra information\r\ntracker.setExtra({ plan: 'premium', source: 'website' });\r\n\r\n// Send custom tracking data\r\ntracker.sendTracker({\r\n  event: 'customEvent',\r\n  targetKey: 'buttonClick',\r\n  // Add more data as needed\r\n});\r\n```\r\n\r\n## Contributing\r\n\r\nIf you'd like to contribute to this project, feel free to open issues or submit pull requests. Contributions are welcome!\r\n\r\n## License\r\n\r\nThis project is licensed under the [MIT License](./LICENSE).\r\n\r\nMake sure to replace the placeholder URLs, API endpoints, and other details with your actual project information. If you have specific sections or details you want to highlight, feel free to modify the template accordingly.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdext7r%2Ftracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdext7r%2Ftracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdext7r%2Ftracker/lists"}