Get Session Details
Get the current session ID with FS.getCurrentSession
.
Get a link to the session replay with FS.getCurrentSessionURL
.
Since 1.3
Get a link to the current moment in time in session replay with FS.getCurrentSessionURL(boolean)
Parameters
now boolean optional
Default value: false
If true
, the returned URL links to the moment in the replay when the method is invoked. Otherwise, the URL returned by the method links to the beginning of the session replay.
Special Consideration
The Fullstory SDK always fetches the latest privacy rules from the server before starting capture.
If called before a session is initialized, these methods will return null. You can register a callback to be notified of session data and get a replay link as soon as the session is ready.
- Java
- Kotlin
public static String FS.getCurrentSession();
public static String FS.getCurrentSessionURL();
public static String FS.getCurrentSessionURL(boolean now);
Example Invocation
Get a link to the beginning of the session replay
// Can be called from anywhere in your code to retrieve a session replay link
// Note: This will be null if called before Fullstory has fully initialized a session
String sessionUrl = FS.getCurrentSessionURL();
Get a link to the current moment in time in the session replay
String sessionUrl = FS.getCurrentSessionURL(true);
Get the current session ID
String sessionId = FS.getCurrentSession();
fun FS.getCurrentSession(): String?
fun FS.getCurrentSessionURL(): String?
fun FS.getCurrentSessionURL(now: Boolean): String?
Example Invocation
Get a link to the beginning of the session replay
// Can be called from anywhere in your code to retrieve a session replay link
// Note: This will be null if called before Fullstory has fully initialized a session
val sessionUrl = FS.getCurrentSessionURL()
Get a link to the current moment in time in the session replay
val sessionUrl = FS.getCurrentSessionURL(true)
Get the current session ID
val sessionId = FS.getCurrentSession()