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
Summary
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.
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
Rank 5: Hypervisor
Sep 5, 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
Sep 5, 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
Rank 5: Hypervisor
Sep 5, 2023, 23:28
Huh - the projectId in the request from the console is console, not the projectId for current project
ideclon
Rank 5: Hypervisor
Sep 5, 2023, 23:29
I guess this isn't going to be as simple as I thought it would 😦