JavaScript SDK ⁠-⁠ 'start' method

This method is used to start the tracker. By starting the tracker, the recording of the session starts.

start(startOpts?: Partial<StartOptions>): Promise<StartPromiseReturn>

The start method accepts an optional parameter where you can customize different aspects of the recording:

  • userID: string: used to manually set the user ID to track it across sessions. This is a string value and it can be anything you want.
  • metadata: Record<string, string>: manually set metadata values. Check the Metadata section to learn more about this feature.
  • forceNew: boolean: used to force a new session after page refresh. By default it’s set to false, so after a refresh the session is kept.
  • sessionToken: string: used is some integrations.
  • assistOnly: boolean: launches tracker in assist-only mode which will skip sending session data to backend (EE edition feature)

Once started, the method will return a promise with a session info object containing:

  • sessionID: string: A string value representing the ID of the started session. Starts the tracker (and the recording process) then returns a promise with session info (sessionID, sessionToken, userUUID).