JavaScript SDK - getSessionInfo method

Details about the getSessionInfo method from OpenReplay's SDK

JavaScript SDK ⁠-⁠ getSessionInfo method

This method returns information about the current session: its ID, metadata, user ID and start time.

getSessionInfo(): SessionInfo | null

Returns null if the tracker isn’t initialized, otherwise an object of the following shape:

interface SessionInfo {
  sessionID: string | undefined
  metadata: Record<string, string>
  userID: string | null
  timestamp: number      // session start, ms
  projectID?: string
}