Skip to main content

Get Session Details

Generate a link to the replay of the current session

Create a link to either the beginning of the session replay or to a specific moment in time in the replay.

Parameters
    now boolean optional

    Default value: false

    If false (or if the now parameter is not provided), the URL returned by the method links to the beginning of the session replay. If true, the returned URL links to the moment in the replay when the method is invoked.

Special Consideration

When the Fullstory Native Mobile instrumentation SDK starts up, it immediately fetches the latest privacy rules from the server. No information is recorded before these privacy rules have been fetched.

This method can be used once Fullstory has been fully initialized. If called before a session is initialized, we will return a null value.

You can call the currentSessionURL computed property anytime during a session to get the URL to your replay session or use the onReady listener method to retrieve sessionUrl parameter after the recording has started.

ES6

FullStory.getCurrentSessionURL().then((url) => {
})

async/await

const url = await FullStory.getCurrentSessionURL()

This function returns the URL for the current Fullstory session, which will link to the beginning of the session.

Example Invocation

You can use the onReady listener method to retrieve the sessionUrl:

ES6
FullStory.onReady().then((result) => {
const replayStartUrl = result.replayStartUrl
const replayNowUrl = result.replayNowUrl
const sessionId = result.sessionId
// This will give you the sessionURL when the recording begins.
console.log(`Fullstory did start session with URL ${replayStartUrl}`)
})
async/await
const { replayStartUrl, replayNowUrl, sessionId } = await FullStory.onReady()
// This will give you the sessionURL when the recording begins.
console.log(`Fullstory did start session with URL ${replayStartUrl}`)
})
ES6
FullStory.currentSessionURL().then((url) => {
console.log(`Fullstory session URL: ${url}`)
})
async/await
const url = await FullStory.currentSessionURL()
console.log(`Fullstory session URL: ${url}`)