{"id":18875991,"url":"https://github.com/activitywatch/aw-client-js","last_synced_at":"2025-04-06T14:10:39.044Z","repository":{"id":8210416,"uuid":"57276953","full_name":"ActivityWatch/aw-client-js","owner":"ActivityWatch","description":"Client library for ActivityWatch in JavaScript","archived":false,"fork":false,"pushed_at":"2025-03-11T12:04:03.000Z","size":281,"stargazers_count":35,"open_issues_count":4,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T18:50:28.633Z","etag":null,"topics":["activitywatch","javascript","nodejs","typescript"],"latest_commit_sha":null,"homepage":null,"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/ActivityWatch.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},"funding":{"github":["ActivityWatch"],"open_collective":"activitywatch","liberapay":"ActivityWatch","custom":["https://activitywatch.net/donate/"]}},"created_at":"2016-04-28T06:33:51.000Z","updated_at":"2025-03-11T11:47:49.000Z","dependencies_parsed_at":"2023-09-23T14:41:01.464Z","dependency_job_id":"7b2834c6-d273-4ef8-9656-9bb852b98877","html_url":"https://github.com/ActivityWatch/aw-client-js","commit_stats":{"total_commits":139,"total_committers":9,"mean_commits":"15.444444444444445","dds":"0.47482014388489213","last_synced_commit":"07334d2aab4db089bcd3a19a7ad88a0e1dbf443a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActivityWatch%2Faw-client-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActivityWatch%2Faw-client-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActivityWatch%2Faw-client-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActivityWatch%2Faw-client-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActivityWatch","download_url":"https://codeload.github.com/ActivityWatch/aw-client-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492513,"owners_count":20947544,"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":["activitywatch","javascript","nodejs","typescript"],"created_at":"2024-11-08T06:10:08.605Z","updated_at":"2025-04-06T14:10:39.021Z","avatar_url":"https://github.com/ActivityWatch.png","language":"TypeScript","readme":"# aw-client-js\n\nClient library for [ActivityWatch](http://activitywatch.net) in TypeScript/JavaScript.\n\n[![Build Status](https://github.com/ActivityWatch/aw-client-js/workflows/Build/badge.svg)](https://github.com/ActivityWatch/aw-client-js/actions)\n[![npm](https://img.shields.io/npm/v/aw-client)](https://www.npmjs.com/package/aw-client)\n[![Known Vulnerabilities](https://snyk.io/test/github/ActivityWatch/aw-client-js/badge.svg)](https://snyk.io/test/github/ActivityWatch/aw-client-js)\n\n## Install\n\n```sh\nnpm install aw-client\n```\n\n## Usage\n\nThe library uses Promises for almost everything, so either use `.then()` or async/await syntax.\n\nThe example below is written with `.then()` to make it easy to run in the node REPL.\n\n```javascript\nconst { AWClient } = require('aw-client');\nconst client = new AWClient('test-client')\n\n// Get server info\nclient.getInfo().then(console.log);\n\n// List buckets\nclient.getBuckets().then(console.log);\n\n// Create bucket\nconst bucketId = \"test\";\nclient.createBucket(bucketId, \"bucket-type\", \"your-hostname\");\n\n// Send a heartbeat\nconst nowStr = (new Date()).toISOString();\nconst heartbeat = {timestamp: nowStr, duration: 0, data: { label: \"just testing!\" }};\nclient.heartbeat(bucketId, 5, heartbeat);\n```\n\n## Contribute\n\n### Setup your dev environment\n\n```sh\nnpm install\n```\n\n### Build the library\n\n```sh\nnpm run compile\n```\n\n### Run the tests\n\n```sh\nnpm test\n```\n","funding_links":["https://github.com/sponsors/ActivityWatch","https://opencollective.com/activitywatch","https://liberapay.com/ActivityWatch","https://activitywatch.net/donate/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivitywatch%2Faw-client-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivitywatch%2Faw-client-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivitywatch%2Faw-client-js/lists"}