Get User Sessions

Overview

This guide covers how to get a user's active sessions, which can be used as a way to show their online status.

Get a User's Sessions

Given a user's ID you can get their sessions. The call to get a user's sessions is paginated.

application.getUserSessions({ user_id: "USR-id", page_size: 20 }).then((user_sessions_page) => {
  // handle page of sessions
}).catch((error) => {
  // handle error
});

If the sessions page contains a session object, you can assume that the user has been recently connected to the Vonage Client SDK.