@vinu Ah, you'll want to pass an actual uid into the _uid query parameter, not a user token. I think that's the issue here.
API endpoint to get online users and active topics
@Staff ACP shows total number of online users and guests at any time on the dashboard.
Similarly one can see the topics that people are reading right now. I'm curious if I can show this information in a widget on topic.tpl. is there an API endpoint that can be used to read this from?
If not where is this info saved in database?
scottalanmiller Community Rep
I've not looked, but I suspect that this is calculated, not stored.
@scottalanmiller is correct, those numbers are produced on the fly based on active websocket sessions, and not stored anywhere.
However, you might be interested in https://github.com/barisusakli/nodebb-plugin-browsing-users, which brings a live-list of current users in-topic back to topic.tpl
Copyright © 2023 NodeBB | Contributors