Utilities

Dashboard session URL

Pre API 2.0

const sessionURL = Smartlook.getDashboardSessionUrl(false);
const sessionURLWithTimestamp = Smartlook.getDashboardSessionUrl(true);

API 2.0

Smartlook.getSessionUrl(successCallback);
Smartlook.getSessionUrlWithTimestamp(successCallback);

function successCallback(sessionUrl: string) {
	console.log('Smartlook recording:' + isRecording);
}

Session URL documentation.

Dashboard visitor URL

Pre API 2.0

const visitorURL = Smartlook.getDashboardVisitorUrl();

API 2.0

Smartlook.getUserUrl(successCallback);

function successCallback(userUrl: string) {
	console.log('User url:' + userUrl);
}

User URL documentation.

Integration listeners

Pre API 2.0

Smartlook.registerIntegrationListener(
		dashboardSessionUrlCallback: (url: string) => void,
		dashboardVisitorUrlCallback: (url: string) => void,
	);

API 2.0

// A callback function that gets called when the user URL changes.
function urlChangedCallback(url: string) {
  console.log('Emitted url', url);
}

Smartlook.registerUserUrlChangedListener({
  userUrlChangedCallback: urlChangedCallback
});
  
Smartlook.registerSessionUrlChangedListener({
  sessionUrlChangedCallback: urlChangedCallback
});