{"id":15013447,"url":"https://github.com/veliovgroup/meteor-user-status","last_synced_at":"2026-03-03T16:39:48.088Z","repository":{"id":27511494,"uuid":"30992182","full_name":"veliovgroup/meteor-user-status","owner":"veliovgroup","description":"Reactively track user's online, offline, and idle statuses","archived":false,"fork":false,"pushed_at":"2022-06-03T13:21:35.000Z","size":37,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T04:44:28.445Z","etag":null,"topics":["meteor","meteor-package","meteorjs","performance-tuning","user-experience","ux"],"latest_commit_sha":null,"homepage":"https://atmospherejs.com/ostrio/user-status","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/veliovgroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"dr-dimitru","custom":"https://paypal.me/veliovgroup"}},"created_at":"2015-02-18T23:12:59.000Z","updated_at":"2023-08-09T14:27:37.000Z","dependencies_parsed_at":"2022-09-02T09:11:20.339Z","dependency_job_id":null,"html_url":"https://github.com/veliovgroup/meteor-user-status","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/veliovgroup/meteor-user-status","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2Fmeteor-user-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2Fmeteor-user-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2Fmeteor-user-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2Fmeteor-user-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veliovgroup","download_url":"https://codeload.github.com/veliovgroup/meteor-user-status/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2Fmeteor-user-status/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30052094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T15:26:47.567Z","status":"ssl_error","status_checked_at":"2026-03-03T15:26:17.132Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["meteor","meteor-package","meteorjs","performance-tuning","user-experience","ux"],"created_at":"2024-09-24T19:44:17.737Z","updated_at":"2026-03-03T16:39:48.057Z","avatar_url":"https://github.com/veliovgroup.png","language":"JavaScript","funding_links":["https://github.com/sponsors/dr-dimitru","https://paypal.me/veliovgroup","https://github.com/sponsors/veliovgroup"],"categories":[],"sub_categories":[],"readme":"[![support](https://img.shields.io/badge/support-GitHub-white)](https://github.com/sponsors/dr-dimitru)\n[![support](https://img.shields.io/badge/support-PayPal-white)](https://paypal.me/veliovgroup)\n\u003ca href=\"https://ostr.io/info/built-by-developers-for-developers\"\u003e\n  \u003cimg src=\"https://ostr.io/apple-touch-icon-60x60.png\" height=\"20\"\u003e\n\u003c/a\u003e\n\n# Meteor user-status\n\nReactive user's online, offline, and idle status updates. Current user's status stored in `Meteor.user().profile.status.online`, returns `Boolean` value.\n\n- __Demo:__ [`meteor-user-status-demo`](https://github.com/veliovgroup/meteor-user-status-demo)\n\n## Install:\n\n```shell\nmeteor add ostrio:user-status\n```\n\n### ES6 Import:\n\n```js\nimport { UserStatus } from 'meteor/ostrio:user-status';\n```\n\n## API\n\n`new UserStatus({opts})` constructor accepts couple of options:\n\n- `opts` {*Object*}\n- `opts.throttleTiming` {*Number*} — time in milliseconds between consecutive method calls; Default: `2048`\n- `opts.idleTimeout` {*Number*} — timeout in milliseconds to consider user status __idle__; Default: `30000`\n\n```js\nimport { UserStatus } from 'meteor/ostrio:user-status';\nconst userStatus = new UserStatus({ idleTimeout: 5000 });\n```\n\n- `userStatus.status` {*ReactiveVar*} — Returns *String*, one of: `offline`, `online`, or `idle`\n- `userStatus.stop()` {*Function*} — Stop tracking user's status\n- `userStatus.start()` {*Boolean*} — Start tracking user's status, *called upon constructor initialization*\n- `userStatus.isRunning` {*Boolean*}\n\n## Usage\n\nUse it as it is on the Client or with `accounts-*` packages. When used with *Accounts* — `ostrio:user-status` will update user's record in a MongoDB with its current status. Package work silently in the background and __doesn't require any setting up__, just initialize constructor.\n\nOnce initialized — use `userStatus.status` *ReactiveVar* to get current user's status in front end.\n\n```js\nimport { Meteor } from 'meteor/meteor';\nimport { UserStatus } from 'meteor/ostrio:user-status';\n\n// INITIATE UserStatus ON CLIENT/BROWSER\n// TO BUILD FONT END LOGC AROUND online AND idle STATUSES\nif (Meteor.isClient) {\n  const userStatus = new UserStatus();\n\n  // [Reactive] get current user's status, one of — offline, online, idle\n  userStatus.status.get();\n\n  // Stop tracking user's status on the client (browser)\n  userStatus.stop();\n\n  // Start tracking user's status on the client (browser),\n  // without creating `new UserStatus()` instance\n  userStatus.start();\n}\n\n// OPTIONALLY INITIATE UserStatus ON SERVER\n// THIS IS REQUIRED ONLY TO UPDATE USER'S OBJECT IN MONGODB\nif (Meteor.isServer) {\n  // NOTE: WHEN INITIALIZED ON SERVER\n  // LOGIN/LOGOUT HOOKS APPLIED TO ALL USERS\n  const userStatus = new UserStatus();\n\n  // Stop tracking user's status on the Server\n  userStatus.stop();\n\n  // Re-start tracking user's status on the Server\n  userStatus.start();\n\n  // NOTE: CALLING `new UserStatus()` TWICE\n  // ON THE SERVER WILL THROW AN EXCEPTION!\n}\n```\n\n### Updated user's object\n\n```js\n{\n  connection: String, //-\u003e Current or last used DDP Connection ID\n  profile: {\n    status: {\n      online: Boolean, //-\u003e Is user online\n      idle: Boolean,   //-\u003e Is user online but idle\n      lastLogin: Date, //-\u003e Current or last login time\n      lastSeen: Date   //-\u003e Last Date when user has changed its status\n    }\n  }\n};\n```\n\n## Idle Status\n\n__Why idle?:__ Some apps require your constant attention. Such apps often include games, media players, anything that is CPU/battery intensive, and so on. For these kinds of apps, it may be important (as well as user-friendly) to do something when a user is no longer actively interacting with your app.\n\n__Why online and last seen?:__ Some apps like chats, forums and other social platforms may require to show user's `(on|off)line` status. If user is offline at the moment such apps require to show the last date when user was active.\n\n__Why track connection id?:__ Established DDP connection is user-less, to find right user from database we're using DDP's `connection` id.\n\n## Support this project:\n\n- [Sponsor veliovgroup via GitHub](https://github.com/sponsors/veliovgroup) — support company behind this package\n- [Support via PayPal](https://paypal.me/veliovgroup) — support our open source contributions\n- Use [ostr.io](https://ostr.io) — [Monitoring](https://snmp-monitoring.com), [Analytics](https://ostr.io/info/web-analytics), [WebSec](https://domain-protection.info), [Web-CRON](https://web-cron.info) and [Pre-rendering](https://prerendering.com) for a website\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveliovgroup%2Fmeteor-user-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveliovgroup%2Fmeteor-user-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveliovgroup%2Fmeteor-user-status/lists"}