Skip to Content
You are viewing a beta version of Clerk Docs
Visit the latest docs
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

SessionWithActivities

The SessionWithActivities object is a modified [Session][session-ref] object. It contains most of the information that the [Session][session-ref] object stores, adding extra information about the current session's latest activity.

The additional data included in the latest activity are useful for analytics purposes. A SessionActivity object will provide information about the user's location, device and browser.

While the SessionWithActivities object wraps the most important information around a [Session][session-ref] object, the two objects have entirely different methods.

Properties

NameTypeDescription
idstringA unique identifier for the session.
statusSessionStatusThe current state of the session.
lastActiveAtDateThe time the session was last active on the [Client][client-ref].
abandonAtDateThe time when the session was abandoned by the user.
expireAtDateThe time the session expires and will seize to be active.
latestActivitySessionActivityAn object that provides additional information about this session, focused around user activity data.

Methods

revoke()

Marks this session as revoked. If this is the active session, the attempt to revoke it will fail.

Users can revoke only their own sessions.

function revoke(): Promise<SessionWithActivities>;

Types

SessionActivity

NameTypeDescription
idstringA unique identifier for the session activity record.
browserNamestring | undefinedThe name of the browser from which this session activity occurred.
browserVersionstring | undefinedThe version of the browser from which this session activity occurred.
deviceTypestring | undefinedThe type of the device which was used in this session activity.
ipAddressstring | undefinedThe IP address from which this session activity originated.
citystring | undefinedThe city from which this session activity occurred. Resolved by IP address geo-location.
countrystring | undefinedThe country from which this session activity occurred. Resolved by IP address geo-location.
isMobileboolean | undefinedWill be set to true if the session activity came from a mobile device. Set to false otherwise.

Last updated on February 21, 2024

What did you think of this content?

Clerk © 2024