
My attention is to get logged in ( online user list). how this is possible as appwrite server sdk is not ready for realtime yet.

Logging in does not translate to "online users"

What so you mean? So when I subscribe to account channel! It returns session is not valid

So can we get something like userId of logged in user!

I understand other security related info cannot be received!

Please be as informative as you can. As your original post does not really explain anything. When a user signs in, that user receives a session object. How do you define "online user" in this context?

How does your approach look like? What is your code? You have to provide a lot more information than that

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>');
client.subscribe('account', response => {
// Callback will be executed on all account events.
console.log(response);
});
``` based on the document, I. could use real time to subcribe to account channel, so whenever user create session ( login) it would return to the subcriber! my intension is to collect those user id having the sessions (login) . then in the system can identified them as online or active.

In appwrite functions you are supposed to use the event trigger https://appwrite.io/docs/advanced/platform/events

Also the user can stop the app in the meantime. So not sure what you mean with "online" and "active"

Just because the user logged in at some point does not nessecarily mean that the user is online as long as the session is active

user should be considered active until it left broswer

And how are you going to know when it leaves?

if I use nextjs, onroot layout component disposed, trigger to remove from the collection. then all subcriber should be notified

the workaround solution for this I could think of is creating separated collection UserActive , and when user login -> manually update add userId to the collection then giving real time subcription to that collection! however, i see there is way to subcribe to 'account' channel, which should be more appropriate
Recommended threads
- Error 1.7.4 console team no found
In console when i go to auth, select user, select a membership the url not work. Only work searching the team. It is by the region. project-default- and i get ...
- Is Quick Start for function creation wor...
I am trying to create a Node.js function using the Quick Start feature. It fails and tells me that it could not locate the package.json file. Isn't Quick Start ...
- functions of 1.4 not work on 1.7
Hi, i updated of 1.4 to 1.7 but the function not work i get it error. Do I need to build and deploy the functions again?
