It’s a pretty common need to track online users of an web application. Sometimes for counting total online users, sometimes by isolated space, e.g., by chatroom or shared list. So, instead of doing similar things every time, I’ve written a javascript module to use in Firebase web applications – Gathering.js.
In this post, I’ll show how it can be used for various type of tracking needs with small code snippets.
BTW, if you are thinking what Firebase is, it’s a Google acquired app development platform for mobile and web. For web application, it’s providing ready made infrastructure with super fast realtime database, flexible Authentication, cross platform Cloud Messaging, static hosting, CDN… (almost) everything you need to develop an app (or a feature) quickly with robustness. You should give it a try.