{"id":15413133,"url":"https://github.com/vesparny/fair-analytics-client-api","last_synced_at":"2025-04-19T07:35:32.211Z","repository":{"id":57148403,"uuid":"90348763","full_name":"vesparny/fair-analytics-client-api","owner":"vesparny","description":"The Fair Analytics client API","archived":false,"fork":false,"pushed_at":"2018-10-04T19:41:36.000Z","size":59,"stargazers_count":20,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T06:51:32.694Z","etag":null,"topics":["analystics","analytics","fair","ga","google"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/vesparny.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-05T07:23:08.000Z","updated_at":"2023-05-12T16:47:25.000Z","dependencies_parsed_at":"2022-08-31T23:50:18.110Z","dependency_job_id":null,"html_url":"https://github.com/vesparny/fair-analytics-client-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vesparny%2Ffair-analytics-client-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vesparny%2Ffair-analytics-client-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vesparny%2Ffair-analytics-client-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vesparny%2Ffair-analytics-client-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vesparny","download_url":"https://codeload.github.com/vesparny/fair-analytics-client-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647301,"owners_count":21139086,"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":["analystics","analytics","fair","ga","google"],"created_at":"2024-10-01T16:55:35.279Z","updated_at":"2025-04-19T07:35:32.193Z","avatar_url":"https://github.com/vesparny.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fair Analytics client JavaScript API\n\n\n\u003e The quickest way to integrate [Fair Analytics](https://github.com/vesparny/fair-analytics) in your app\n\n[![Travis](https://img.shields.io/travis/vesparny/fair-analytics-client-api.svg)](https://travis-ci.org/vesparny/fair-analytics-client-api)\n[![Code Coverage](https://img.shields.io/codecov/c/github/vesparny/fair-analytics-client-api.svg?style=flat-square)](https://codecov.io/github/vesparny/fair-analytics-client-api)\n[![David](https://img.shields.io/david/vesparny/fair-analytics-client-api.svg)](https://david-dm.org/vesparny/fair-analytics-client-api)\n[![npm](https://img.shields.io/npm/v/fair-analytics-client-api.svg)](https://www.npmjs.com/package/fair-analytics-client-api)\n[![npm](https://img.shields.io/npm/dm/fair-analytics-client-api.svg)](https://npm-stat.com/charts.html?package=fair-analytics-client-api\u0026from=2017-04-01)\n[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n[![MIT License](https://img.shields.io/npm/l/fair-analytics-client-api.svg?style=flat-square)](https://github.com/vesparny/fair-analytics-client-api/blob/master/LICENSE)\n[![gzip size](http://img.badgesize.io/https://unpkg.com/fair-analytics-client-api/dist/fair-analytics-client-api.umd.min.js?compression=gzip\u0026label=gzip%20size\u0026style=flat-square)](https://unpkg.com/fair-analytics-client-api/dist/)\n\n\n## Install\n\nThis project uses [node](http://nodejs.org) and [npm](https://npmjs.com). Go check them out if you don't have them locally installed.\n\n```sh\n$ npm i fair-analytics-client-api\n```\n\nThen with a module bundler like [rollup](http://rollupjs.org/) or [webpack](https://webpack.js.org/), use as you would anything else:\n\n```javascript\n// using ES6 modules\nimport fairAnalytics from 'fair-analytics-client-api'\n\n// using CommonJS modules\nvar fairAnalytics = require('fair-analytics-client-api')\n```\n\nThe [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](https://unpkg.com):\n\n```html\n\u003cscript src=\"https://unpkg.com/fair-analytics-client-api/dist/fair-analytics-client-api.umd.js\"\u003e\u003c/script\u003e\n```\n\nYou can find the library on `window.fairAnalytics`.\n\n## Usage\n\n```js\nimport fairAnalytics from 'fair-analytics-client-api'\n\n// create a fa instance\nconst fa = fairAnalytics({\n  url: 'https://fa.yoursite.com' // the URL of your hosted Fair Analytics instance\n})\n\n// track events\nfa.send({\n  event: 'pageView', // event is mandatory and can be anything\n  pathname: window.location.pathname\n})\n.then(res =\u003e {\n  if (res.ok) {\n    console.log('success')\n  }\n})\n.catch(err =\u003e {\n  console.error(err.message)\n})\n```\n\n## Tests\n\n```sh\n$ npm test\n```\n\n## Change Log\n\nThis project adheres to [Semantic Versioning](http://semver.org/).  \nEvery release, along with the migration instructions, is documented in the [CHANGELOG.md](https://github.com/vesparny/fair-analytics-client-api/blob/master/CHANGELOG.md) file.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvesparny%2Ffair-analytics-client-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvesparny%2Ffair-analytics-client-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvesparny%2Ffair-analytics-client-api/lists"}