{"id":15284228,"url":"https://github.com/astrolytics-io/astrolytics-desktop","last_synced_at":"2025-04-12T23:21:38.021Z","repository":{"id":191396152,"uuid":"684709698","full_name":"astrolytics-io/astrolytics-desktop","owner":"astrolytics-io","description":"Desktop (Electron \u0026 Tauri) SDK for Astrolytics.io","archived":false,"fork":false,"pushed_at":"2023-09-11T17:09:26.000Z","size":793,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-26T17:21:22.676Z","etag":null,"topics":["analytics","electron","tauri"],"latest_commit_sha":null,"homepage":"https://www.astrolytics.io","language":"TypeScript","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/astrolytics-io.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T17:36:08.000Z","updated_at":"2025-03-03T06:09:31.000Z","dependencies_parsed_at":"2024-10-14T14:41:43.321Z","dependency_job_id":"c2f3e232-4fe6-48ea-ab46-1080d3a6e318","html_url":"https://github.com/astrolytics-io/astrolytics-desktop","commit_stats":null,"previous_names":["astrolytics-io/astrolytics-desktop"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrolytics-io%2Fastrolytics-desktop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrolytics-io%2Fastrolytics-desktop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrolytics-io%2Fastrolytics-desktop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrolytics-io%2Fastrolytics-desktop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrolytics-io","download_url":"https://codeload.github.com/astrolytics-io/astrolytics-desktop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248644181,"owners_count":21138564,"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":["analytics","electron","tauri"],"created_at":"2024-09-30T14:51:31.554Z","updated_at":"2025-04-12T23:21:37.996Z","avatar_url":"https://github.com/astrolytics-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astrolytics.io Desktop SDK\n\n![Astrolytics.io](docs/readme-banner.jpg)\n\nAstrolytics currently works with Electron and Tauri. If you'd like us to support another desktop framework, send us an email to hello@astrolytics.io.\n\n## Table of Contents\n\n1. [Getting Started](#getting-started)\n2. [Usage](#usage)\n3. [How to Contribute](#how-to-contribute)\n\n## Getting Started\n\nTo get started with Astrolytics, create an account at [Astrolytics](https://dash.astrolytics.io/login) and grab the App ID, then\nuse the SDK to start tracking events.\n\n### Installation\n\nAs NPM package (recommended)\n\n```bash\n# with npm\nnpm install astrolytics-desktop\n\n# or with yarn\nyarn add astrolytics-desktop\n```\n\n### Usage\n\n\n```javascript\nimport Astrolytics from 'astrolytics-desktop';\n\nAstrolytics.init('YOUR_APP_ID');\n```\n\nReplace `'YOUR_APP_ID'` with the unique ID of your app. You can get it [here](https://dash.astrolytics.io/account).\n\nYou can check examples with different frameworks [here](./playground).\n\n## API\n\nAstrolytics supports passing the following options as second argument to the `Astrolytics.init()` method:\n\n```js\nAstrolytics.init('APP_ID', {\n  endpoint: 'wss://app.astrolytics.io', // only option, we don't allow self hosting yet :(\n  disableInDev: true, // disable in development mode. We recommend not to call\n                      // `init` method, as that will be more reliable.\n  debug: false, // if set to `true`, will log a bunch of things.\n  disableTracking: false, // will not track anything. You can also use `Astrolytics.disableTracking()`.\n                          // note that some events will still be added to the queue, so if you call\n                          // Astrolytics.enableTracking() again, they will be sent to the server.\n  automaticPageTracking: true, // will track all page changes.\n  reportInterval: 2 * 1000, // at which interval the events are sent to the server.\n  sessionTimeout: 60 * 30 * 1000, // time after which the session is ended\n  cutoff: 60 * 60 * 48 * 1000, // time after which event that were not sent yet are deleted\n  disableErrorReports: false, // wether to disable error tracking\n})\n```\n\n### Tracking\n\nTrack events with optional custom data\n\n```javascript\nAstrolytics.track(\"click\", { foo: 'bar' });\n```\n\n### Error Tracking\n\nTrack errors with a name and the Error object.\n\n```javascript\nAstrolytics.trackError(name, error);\n```\n\nBy default Astrolytics will listen for `window.onerror` and `window.onunhandledrejection` events and send them to the API. If you want\nto disable this behaviour, you can set `disableErrorReports` to `true`:\n\n```js\nAstrolytics.init('APP_ID', { disableErrorReports: true })\n```\n\n### User Identification\n\nIdentify a user by a unique ID and optionally set custom properties.\n\n```javascript\nAstrolytics.identify('04f8846d-ecca-4a81-8740-f6428ceb7f7b', { firstName: 'Brendan', lastName: 'Eich' });\n```\n\n### Page Tracking\n\nTrack page views with the page name and optional parameters. If the page name is not provided, the current window's pathname is used.\n\n```javascript\nAstrolytics.page('/about', { foo: 'baz' });\n```\n\nBy default, Astrolytics will track any page change by polling the url every 50 ms. If you prefer to manually track page changes, set `automaticPageTracking` to false and call `Astrolytics.page()` on every page change.\n\n### Disabling Tracking\n\nTo disable tracking\n\n```javascript\nAstrolytics.disableTracking();\n```\n\n### Enabling Tracking\n\nTo enable tracking\n\n```javascript\nAstrolytics.enableTracking();\n```\n\n## How to Contribute\n\nWe're always looking for contributions from the community. Here's how you can help:\n\n1. **Report Bugs**: Create an issue report detailing the bug you've found.\n2. **Suggest Features**: Have a great idea for Astrolytics? Don't hesitate to put it forward by creating an issue.\n3. **Submit Pull Requests**: Feel free to fix a bug or add a new feature and create a pull request. Make sure to follow the existing code style, and write clear commit messages explaining your changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrolytics-io%2Fastrolytics-desktop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrolytics-io%2Fastrolytics-desktop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrolytics-io%2Fastrolytics-desktop/lists"}