Back

Get current active Realtime sessions

  • 0
  • Web
  • Realtime
ideclon
5 Sep, 2023, 17:54

I'm trying to find a simple way to show the number of active page views. The console shows the number of active Realtime sessions, so I was hoping I could pull the same data, and just have the page I want to monitor listen for something random.

I will have to find a way to know which page it is, but is there any way to get the number of active Realtime sessions with the SDK?

I'm using Svelte

TL;DR
The user is looking for a way to get the number of active Realtime sessions using Svelte. They have tried using the `subscribe(['project', 'connections'])` function but it didn't work. Other users suggest inspecting the network traffic on the Console to see the correct request format. It is mentioned that the user might not have the necessary permissions and a custom solution may be required. There is a code snippet referencing the Realtime sessions in the Console project. Unfortunately, no solution is provided in this support thread.
ideclon
5 Sep, 2023, 17:56

Get current active Realtime sessions

Drake
5 Sep, 2023, 20:41

and im not sure you'll be able to use that for what you need...you'll probably have to find a custom solution

ideclon
5 Sep, 2023, 23:22

Yeah, I already tried subscribe(['project', 'connections']) and I don't receive any events. My guess is that the user doesn't have permissions, and there's currently no way to set them

Drake
5 Sep, 2023, 23:25

only the console user would have access. you can inspect the network traffic on the Console to see what the request should look like

ideclon
5 Sep, 2023, 23:28

Huh - the projectId in the request from the console is console, not the projectId for current project

ideclon
5 Sep, 2023, 23:29

I guess this isn't going to be as simple as I thought it would 😦

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more