You can log specific moments during a user session with appropriate messages. This will allow you to later search and replay them instead of having to watch a whole session in order to find what you need.

SessionStack.log('sample message');

This will simply log ‘sample message’.

The provided argument is not limited to a simple String, but can be any JavaScript object. If the provided object inherits from the JavaScript Error type, SessionStack will capture the corresponding stack trace to provide you with more context when you try to figure out what went wrong.

try {
    // code
} catch (e) {
    SessionStack.log(e); // Will capture the stack trace from the provided error.

You can pass an optional configuration object:

Property NameTypeDescription
levelStringOne of the following:
“info” (default if none is specified)

as follows:

SessionStack.log('sample error message', {
    level: 'error'